(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 8.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[    234658,       5255]
NotebookOptionsPosition[    220310,       4869]
NotebookOutlinePosition[    220787,       4887]
CellTagsIndexPosition[    220744,       4884]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{

Cell[CellGroupData[{
Cell["Mechanic", "Title",
 CellChangeTimes->{{3.52260426209375*^9, 3.522604268765625*^9}}],

Cell[CellGroupData[{

Cell["General", "Section",
 CellChangeTimes->{{3.5719269675877132`*^9, 3.5719269908317537`*^9}}],

Cell[BoxData[
 RowBox[{"<<", "C:\\\\Hopsan\\Compgen\\CompgenNG02.mx"}]], "Input",
 PageWidth->WindowWidth,
 CellChangeTimes->{{3.5039042069364696`*^9, 3.5039042084051447`*^9}, 
   3.5039043176026783`*^9, {3.503905207466113*^9, 3.5039052078411083`*^9}, {
   3.5039109774941587`*^9, 3.5039109827285337`*^9}, 3.5184950305362186`*^9, 
   3.571933744820756*^9}],

Cell[BoxData[
 RowBox[{"Off", "[", 
  RowBox[{"General", "::", "\"\<spell1\>\""}], "]"}]], "Input",
 PageWidth->WindowWidth]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"defaultPath", "=", 
   RowBox[{"ToFileName", "[", 
    RowBox[{"{", 
     RowBox[{
     "\"\<C:\>\"", ",", "\"\<HopsanTrunk\>\"", ",", "\"\<HOPSAN++\>\"", ",", 
      "\"\<ComponentLibraries\>\"", ",", "\"\<defaultLibrary\>\"", ",", 
      "\"\<Special\>\""}], "}"}], "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5757727777685804`*^9, 3.575772792541806*^9}, {
   3.5757728423954945`*^9, 3.5757728498367076`*^9}, {3.57577333888545*^9, 
   3.5757733706315055`*^9}, 3.5757734316206255`*^9, {3.575776746610216*^9, 
   3.57577674854722*^9}, {3.5758034373456383`*^9, 3.5758034687537785`*^9}}],

Cell[CellGroupData[{

Cell[TextData[{
 "Vehicle1D\n",
 StyleBox["Veficle model with aerodrag and rolling resistance",
  FontSize->16]
}], "Section",
 CellChangeTimes->{{3.517653490700202*^9, 3.5176535000438924`*^9}, {
  3.519281473890625*^9, 3.51928149171875*^9}}],

Cell[BoxData[
 RowBox[{"wmr2", "=."}]], "Input",
 CellChangeTimes->{{3.5758036406164827`*^9, 3.5758036411044827`*^9}}],

Cell[CellGroupData[{

Cell["Variables and parameters", "Subsection"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<Vehicle1D\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{
  "brief", "=", "\"\<This is a one dimmensional model of a vehicle\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"defaultPath", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.5137112151875*^9, 3.513711217109375*^9}, {
   3.51378596903125*^9, 3.513785980671875*^9}, 3.515394539753217*^9, {
   3.515775693875*^9, 3.5157757050625*^9}, {3.517048046727305*^9, 
   3.51704806093043*^9}, 3.51707206725*^9, {3.5176530686834764`*^9, 
   3.51765311057437*^9}, {3.517673126703125*^9, 3.517673126796875*^9}, {
   3.52260203590625*^9, 3.522602037546875*^9}, 3.5758034138672905`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "Mc", ",", "1000.", ",", "double", ",", "\"\<kg\>\"", ",", 
       "\"\<Vehicle inertia at\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "cfr", ",", ".02", ",", "double", ",", "\"\<N/N\>\"", ",", 
       "\"\<C roll. resist.coeff.\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "CdA", ",", "0.5", ",", "double", ",", "\"\<m2\>\"", ",", 
       "\"\<effective front area\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "rwheel", ",", "1.", ",", "double", ",", "\"\<m\>\"", ",", 
       "\"\<wheel radius\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "rho", ",", "1.25", ",", "double", ",", "\"\<kg/m3\>\"", ",", 
       "\"\<air density\>\""}], "}"}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5176486934335947`*^9, 3.5176486934492197`*^9}, {
   3.517653302138096*^9, 3.5176533069975023`*^9}, {3.5176533994039116`*^9, 
   3.5176534019663954`*^9}, {3.5188444615543127`*^9, 3.518844465241836*^9}, 
   3.522602096625*^9, {3.5768965601018763`*^9, 3.5768965636425905`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "vc", ",", "0.", ",", "double", ",", "\"\<m/s\>\"", ",", 
       "\"\<Vehicle speed\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "xc", ",", "0.", ",", "double", ",", "\"\<m\>\"", ",", 
       "\"\<Vehicle position\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "fd", ",", "0.", ",", "double", ",", "\"\<N\>\"", ",", 
       "\"\<Aerodynamc drag\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "fr", ",", "0.", ",", "double", ",", "\"\<N\>\"", ",", 
       "\"\<Rolling resistance\>\""}], "}"}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5188412647574997`*^9, 3.518841399347402*^9}, 
   3.5188415819040956`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr1", ",", "0.", ",", "0.", ",", 
       "\"\<Mechanical rotation node 1\>\""}], "]"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr2", ",", "0.", ",", "0.", ",", 
       "\"\<Mechanical rotation node 2\>\""}], "]"}]}], "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.5176487591983776`*^9, 3.5176487636670704`*^9}, {
   3.5176532244344735`*^9, 3.5176533235444827`*^9}, {3.517653387294614*^9, 
   3.5176534082319803`*^9}, {3.517653442778634*^9, 3.517653481294012*^9}, {
   3.5176551190906687`*^9, 3.5176551191219177`*^9}, {3.5176555306322756`*^9, 
   3.5176555425852475`*^9}, {3.51767254496875*^9, 3.517672551703125*^9}, {
   3.5177231354777727`*^9, 3.517723161477606*^9}, {3.5177233896480207`*^9, 
   3.517723409554143*^9}, 3.518841295944461*^9, 3.51884157877916*^9, {
   3.518841881117114*^9, 3.518841886585794*^9}, {3.521780829515625*^9, 
   3.521780830828125*^9}}],

Cell["s=.;fd=.;fr=.;fc=.;", "Input",
 CellChangeTimes->{{3.5768965829982967`*^9, 3.57689659368857*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"localExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"fd", "==", " ", 
      RowBox[{"CdA", " ", "rho", " ", "vc", " ", 
       RowBox[{"Abs", "[", "vc", "]"}], 
       FractionBox["1", "2"]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"fc", "==", " ", 
      RowBox[{"9.82", "*", "Mc", "*", "cfr"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"Br", "==", 
      RowBox[{"Mc", "/", "mTimestep"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"fre", "==", 
      RowBox[{"limit", "[", 
       RowBox[{
        RowBox[{"Br", " ", "vc"}], ",", 
        RowBox[{"-", "fc"}], ",", "fc"}], "]"}]}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.517650016465475*^9, 3.517650017449876*^9}, {
  3.517723208664804*^9, 3.517723252898896*^9}, {3.517723303632946*^9, 
  3.517723338867096*^9}, {3.518843849329424*^9, 3.5188439090009174`*^9}, {
  3.518844334255598*^9, 3.518844377084545*^9}, {3.518844444460453*^9, 
  3.5188444478042245`*^9}, {3.5719323770989146`*^9, 3.5719324034785604`*^9}, {
  3.575803783769483*^9, 3.5758037898394833`*^9}, {3.5943693366376996`*^9, 
  3.594369356204656*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDA", ":=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"Mc", " ", 
        RowBox[{"Der", "[", "vc", "]"}]}], "+", "fre"}], "==", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{
         RowBox[{"(", 
          RowBox[{"tormr1", "+", "tormr2"}], ")"}], "/", "rwheel"}], "-", 
        "fd"}], ")"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "xc", "]"}], "==", "vc"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr1", "]"}], "==", 
      RowBox[{"vc", "/", "rwheel"}]}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.517647850521227*^9, 3.517647850583728*^9}, {
   3.5176493164014125`*^9, 3.517649330620344*^9}, {3.517655137246686*^9, 
   3.5176551609963818`*^9}, {3.5176552461202927`*^9, 
   3.5176552929165688`*^9}, {3.5176553383066125`*^9, 
   3.5176553602907057`*^9}, {3.517655602288323*^9, 3.517655605132146*^9}, {
   3.517672578890625*^9, 3.51767259*^9}, {3.517672824015625*^9, 
   3.5176728260625*^9}, 3.5188415535143433`*^9, {3.571932408220969*^9, 
   3.571932418860188*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemBoundaryEquations", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"tormr1", "==", 
      RowBox[{"cmr1", "-", 
       RowBox[{"Zcmr1", " ", 
        RowBox[{"vc", "/", "rwheel"}]}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"tormr2", "==", 
      RowBox[{"cmr2", "-", 
       RowBox[{"Zcmr2", " ", 
        RowBox[{"vc", "/", "rwheel"}]}]}]}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5176478709744835`*^9, 3.5176478709744835`*^9}, {
  3.517649300151204*^9, 3.517649307073168*^9}, {3.5176551621526175`*^9, 
  3.51765516307448*^9}, {3.51767256096875*^9, 3.51767257159375*^9}, {
  3.5176726039375*^9, 3.517672619546875*^9}, {3.517672827890625*^9, 
  3.517672828984375*^9}, {3.5719324276586037`*^9, 3.571932452072646*^9}, {
  3.571932841251569*^9, 3.5719328424215713`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", " ", "=", " ", 
   RowBox[{"{", 
    RowBox[{"vc", ",", "xc", ",", "thetamr1", ",", "tormr1", ",", "tormr2"}], 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5176492737126045`*^9, 3.5176492761971226`*^9}, {
   3.5176551647775836`*^9, 3.5176551652619524`*^9}, 3.5176558296691437`*^9, {
   3.517672632734375*^9, 3.517672635015625*^9}, {3.517672833375*^9, 
   3.51767283475*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"wmr1", "==", 
      RowBox[{
       RowBox[{"-", " ", "vc"}], "/", "rwheel"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"wmr2", "==", 
      RowBox[{
       RowBox[{"-", " ", "vc"}], "/", "rwheel"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"thetamr2", "==", "thetamr1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"fr", "==", "fre"}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqInertiamr1", "==", 
      RowBox[{"Mc", " ", 
       SuperscriptBox["rwheel", "2"]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqInertiamr2", "==", 
      RowBox[{"Mc", " ", 
       SuperscriptBox["rwheel", "2"]}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{
  3.517649293885499*^9, 3.517655166168191*^9, {3.51767265925*^9, 
   3.517672738703125*^9}, {3.518841557061105*^9, 3.5188415709356613`*^9}, {
   3.52191403278125*^9, 3.521914080109375*^9}, {3.571932456456254*^9, 
   3.5719324867515073`*^9}, 3.575803743484483*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"variable2Limits", "=", 
   RowBox[{"{", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{3.522602134234375*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(1, 1\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.594369478215856*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(2, 1\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.5943694782178564`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(3, 1\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.594369478242859*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Part :: \
partd\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.594369478245859*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\\\"typename\\\" \[Rule] \\\"MechanicVehicle1D\\\"\\)\\), \\(\\(\
\\\"displayname\\\" \[Rule] \\\"MechanicVehicle1D\\\"\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"MechanicVehicle1D.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \
\[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"MechanicVehicle1D.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\)]\\)\\)}\\)\\)\
\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \\(\\(\
\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \
\\(\\({\\(\\(\\\"isopath\\\" \[Rule] \\\"MechanicVehicle1D.svg\\\"\\)\\), \\(\
\\(\\\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \
\[Rule] \\\"MechanicVehicle1D.svg\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \
\\(\\({}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\
\\\"x\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
0.3333333333333333`\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"Pmr1\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"Pmr2\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \
\\(\\(\\(\\(\[LeftSkeleton] 10 \[RightSkeleton]\\)\\)[\\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \
\\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0.6\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
\\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \
\[Rule] \\\"fd\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\\"0.8\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"fr\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.594369478247859*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.59436947825286*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"y\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.59436947825486*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.5943694782568603`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"y\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.5943694782588606`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.5943694782598605`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.52260498009375*^9, {3.522605895640625*^9, 3.522605912*^9}, 
   3.52260614553125*^9, 3.533152645640625*^9, 3.533153557359375*^9, 
   3.53315404265625*^9, 3.533154167796875*^9, 3.53315485153125*^9, 
   3.533195435703125*^9, 3.533207454421875*^9, 3.53322182371875*^9, 
   3.533221928453125*^9, 3.535556429640625*^9, 3.535557185046875*^9, 
   3.535557234890625*^9, 3.535557776671875*^9, 3.53555783553125*^9, 
   3.535608288671875*^9, 3.5356084985625*^9, 3.535609959640625*^9, 
   3.5356119395*^9, 3.53561743865625*^9, 3.535624594171875*^9, 
   3.5356884489473877`*^9, 3.5356888572672777`*^9, 3.535692350508752*^9, 
   3.538977657458536*^9, 3.54977912740625*^9, 3.5547157547021*^9, 
   3.575803382179122*^9, 3.5758035883654833`*^9, 3.575803656805483*^9, 
   3.5758037237814827`*^9, 3.575803757044483*^9, 3.5758037961154833`*^9, 
   3.5762127978027306`*^9, 3.5762130673496823`*^9, 3.5774507036004086`*^9, 
   3.578816721021367*^9, 3.594369478261861*^9}]
}, Open  ]]
}, Open  ]]
}, Closed]],

Cell[BoxData[
 RowBox[{
  RowBox[{"defaultPath", "=", 
   RowBox[{"ToFileName", "[", 
    RowBox[{"{", 
     RowBox[{
     "\"\<C:\>\"", ",", "\"\<HopsanTrunk\>\"", ",", "\"\<HOPSAN++\>\"", ",", 
      "\"\<ComponentLibraries\>\"", ",", "\"\<defaultLibrary\>\"", ",", 
      "\"\<Mechanic\>\"", ",", "\"\<Rotational\>\""}], "}"}], "]"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.5757727777685804`*^9, 3.575772792541806*^9}, {
   3.5757728423954945`*^9, 3.5757728498367076`*^9}, {3.57577333888545*^9, 
   3.5757733706315055`*^9}, 3.5757734316206255`*^9, {3.575776746610216*^9, 
   3.57577674854722*^9}, {3.5758034373456383`*^9, 3.575803480129916*^9}, {
   3.575803531639483*^9, 3.575803542775483*^9}}],

Cell[CellGroupData[{

Cell["Shaft", "Section",
 CellChangeTimes->{{3.52260439790625*^9, 3.522604398390625*^9}}],

Cell["\<\
Shaft with torsional spring implemented using bilateral delay lines.\
\>", "Text"],

Cell[GraphicsData["Metafile", "\<\
CF5dJ6E]HGAYHf4PEfU^I6mgLb15CDHPAVmbKF5d0@00015X0@0006`0002Coooo=`H00>@G00362P00
?P4005dM001;HP00^bX00215CDH00040J14009P0000300000000000000000000XQ800:PJ003:0000
8@400000000000000000010E0`3XJ0@0AP0002`0000P0000ADe6:`500@0L00004000008@`=/00000
F08005P200160000G00005000015CDH[8T0400`0000000007T0900`000000000940100`000000000
<4020100000400000020?b501`0<0000000000A0000<0000000004H0000X0000700004M4BD<20000
B`000>l6000^5`003`X0000000160000:00001`00017A4U30P0007D0003B20000AL0080900000000
AP0005P0001<0000ADe6:bY0000T000060000000P3l000200000P000P3l000200000P0Y0080T0000
60000;:b/_l10000Zj[a@UEG3DFY9;A5/:XV@b4000080000HP0000`000010000900002@00000080n
000000000000080n00000000000200009`0001P00001000000000;:b/P0000009@0000`000010000
9@0000`000080020EP000300001h0000e@P00?dF001l2@001@000>81E2?R0NlUm5__9OAKE2?R0E@S
9@0000`0000700209@0000`000000020900002@00000081000000000000008100000000000020000
AP0009`0002@0000ADe6:`Q000900000=000008@`=/00000eP00000000000<Q00P00008000000011
0P00000000024<3K00000;:b/_l8@043?000030000024<3K10000000002[Z_52EEL=AJ^ZlD80`QM5
EN^gA@325dEEjkM5EEL=A@010H4E@040400000@000000000>P0000`000080000900002@00000080n
000000000000080n0000000000020000G`0003P000020000>0000000000h00000000000P0@0I0000
00000;:b/P00000000000000000U000030000080000U0000300000D0081F0000;00005L0002d2000
7QL009d900040000hP5D8n81kbGdFnlUm5]D8bD0000<00001`00P2D0000<00000000P2@0000T0000
0020@000000000000020@000000000000P0002P0000<00000P0003X0000<00002P000280000<0000
ooooodH0000L0000400004E=AR/4@0003000000000160000500000P00017A4U30`0004H0000X0000
700004M4BD<20000HP0006P7000@5`00^@L0000000160000F00004`00015CDH[:T0002@0000H0000
0020?`00080000200020?`00080000202T00P2@0000H0000/[:bo`40002[:/a2083]A5@_]DE@eI52
8@0000P0001R000030000040000T000090000000P3h0000000000000P3h0000000000080000U0000
30000040000U0000300000P0081F0000<00006D0001[1`0031L00;D700050000U`6^7IL1dQh^G=8N
;Ub^7IL1[QdU0000300000L0080U000030000000080T000090000000P400000000000000P4000000
0000008000160000W00009000015CDH[24020T00000d00000Q30f`00003F000000000000b4020000
0P000000044200000000008@`=/00000/[:bo`Q00`<l0000<000008@`=/4000000000:/Zc480P>e4
Zb[<@UFMmT@0H;Q5EIgfA01P^4D0P>e40041PAE00`0@000010000080000j0000300000P0000T0000
90000000P3h0000000000000P3h0000000000080001O0000>0000080000h0000000003P000000000
020101T000000000/[:b000000000000000002D0000<00000P0002D0000<00001@00P5H0000/0000
A00004X7000]5`00ePL000@0002G0JhMU`7B7RiLdQh^G:hM9@0000`0000700209@0000`000000020
900002@00000081000000000000008100000000000020000:00000`000020000>P0000`0000:0000
8P0000`0003oooooAP0001`0000@0000ADe6:`A0000<0000000004H0000D0000200004M4BD<30000
AP0002P0000L0000AdA9@`80001;0000k`H002hG000?2P00000004H000300000]00004E=AR/Z@000
900001P00000080o0000P0000800080o0000P0000808@0@2@00003@000024<3K00000=H000000000
0018@P80000200000000@@80000000000Q30f`000000003o24050c`0000`00000Q30f`@000000000
0038@P00hD@00<Q2060OAJ^R^4D0H1m5Zj:hA@00hD@00@615D050100000400001000024000080000
HP0000`000010000>P0000`000080000900002@00000080n000000000000080n0000000000020000
G`0003P000020000>0000000000h00000000000P0@380000000000000000000000000000000U0000
30000080000U0000300000D0081F0000;00009?ooolg1P00i1L00<H:00040000SP4N78h1eRM@G=HW
D5`N72D0000<00001`00P2D0000<00000000P2@0000T00000020@000000000000020@00000000000
0P0002P0000<00000P0003X0000<00002P000280000<0000ooooodH0000L0000400004E=AR/4@000
3000000000160000500000P00017A4U30`0004H0000X0000700004M4BD<20000M@000=8800015`00
P0T0000000160000F00004`00015CDH[:T0002@0000H00000020?`00080000200020?`0008000020
2T00P2@0000H0000/[:bo`40002[Z_52EEL=AJTT]4F`ZRI38@0000P0001R000030000040000T0000
90000000P3h0000000000000P3h0000000000080000U000030000040000U0000300000P0081F0000
<00007P0003E2000oAH007`900050000hP5D8n81kbGdFnlUm5]D8n81E2<U0000300000L0080U0000
30000000080T000090000000P400000000000000P40000000000008000160000800001@00015CDH[
5D01010000040000000003X0000<0000200002@0000T00000020?P00000000000020?P0000000000
0P0005l0000h00000P0003P000000000>0000000000080406@000000002b/[800000000000000000
9@0000`0000200009@0000`000050020EP0002`0001G0000]0P001hG002M2@0010000>81E2?R0NlU
m5__9OAKE2<U0000300000L0080U000030000000080T000090000000P400000000000000P4000000
00000080000X000030000080000j0000300000X0000R000030000?oooom60000700001000015CDH[
140000`000000000AP0001@000080000AdA9@`<000160000:00001`00017A4U30P000680001X1`00
41L00;T700000000AP0005P0001<0000ADe6:bY0000T000060000000P3l000200000P000P3l00020
0000P0Y0080T000060000;:b/_l10000Zb[<@P20kDAD;kE5D=FA@R4000080000HP0000`000010000
900002@00000080n000000000000080n00000000000200009@0000`0000100009@0000`000080020
EP000300001U0000J`L000`G002e1`001@0009L1[QfG0M8N;UcB7RiL[QfG0JhM9@0000`000070020
9@0000`000000020900002@00000081000000000000008100000000000020000AP000200000D0000
ADe6:aE00`0@000010000080000j0000300000P0000T000090000000P3h0000000000000P3h00000
00000080001O0000>0000080000h0000000003P000000000020101T000000000/[:b000000000000
000002D0000<00000P0002D0000<00001@00P5H0000/0000A00004X7000]5`00ePL000@0002G0JhM
U`7B7RiLdQh^G:hM9@0000`0000700209@0000`000000020900002@0000008100000000000000810
0000000000020000:00000`000020000>P0000`0000:00008P0000`0003oooooAP0001`0000@0000
ADe6:`A0000<0000000004H0000D0000200004M4BD<30000AP0002P0000L0000AdA9@`80001;0000
k`H002hG000?2P00000004H000140000>00004E=AR/Z@000900001P00000080o0000P0000800080o
0000P000080E@0D0400000@0000400008@0000P0001R000030000040000j0000300000P0000T0000
90000000P3h0000000000000P3h0000000000080001O0000>0000080000h0000000003P000000000
02010<P0000000000000000000000000000002D0000<00000P0002D0000<00001@00P5H0000/0000
ToooocL6003T5`00aPX000@0002>0AhLSP7F9e1LeRM@G1hL9@0000`0000700209@0000`000000020
900002@00000081000000000000008100000000000020000:00000`000020000>P0000`0000:0000
8P0000`0003oooooAP0001`0000@0000ADe6:`A0000<0000000004H0000D0000200004M4BD<30000
AP0003@0000X0000ADe6:bY0000T000060000000P3l000200000P000P3l000200000P24000080000
HP0000`000010000C00006@0002Loooo@0H00=/G002m2P00W?oood0600106000OP@002T0ZP000000
00000000P3l0000000000000P3l000000000000000000000000000000000000000000280000<0000
ooooodH0000L0000400004E=AR/2@00030000000000>000050000000000@00005000
\>"], "Text",
 ImageSize->{209.313, 28.75},
 ImageMargins->{{22, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<RotShaft\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<Rotational shaft with torsional spring\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentC\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"defaultPath", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"ResetComponentVariables", "[", "]"}]}], "Input",
 CellChangeTimes->{{3.5137112151875*^9, 3.513711217109375*^9}, {
   3.51378596903125*^9, 3.513785980671875*^9}, 3.515394539753217*^9, {
   3.515775693875*^9, 3.5157757050625*^9}, {3.517048046727305*^9, 
   3.51704806093043*^9}, 3.51707206725*^9, {3.5176530686834764`*^9, 
   3.51765311057437*^9}, {3.517673126703125*^9, 3.517673126796875*^9}, {
   3.5177214423487377`*^9, 3.517721453114225*^9}, {3.5177222281793466`*^9, 
   3.517722236008023*^9}, {3.5192815953125*^9, 3.5192816093125*^9}, {
   3.5209603410625*^9, 3.52096034128125*^9}, {3.54985636715625*^9, 
   3.5498563754375*^9}, 3.5758034074886527`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "Ks", ",", "1000.", ",", "double", ",", "\"\<Nm/rad\>\"", ",", 
       "\"\<Spring constant\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "alpha", ",", "0.9", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<damping factor\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.519318796546875*^9, 3.519318804953125*^9}, {
   3.54978019078125*^9, 3.549780199734375*^9}, 3.54985607496875*^9, {
   3.549856275109375*^9, 3.549856289484375*^9}, {3.571932894868863*^9, 
   3.571932896694066*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"fak", "=", 
   FractionBox["1", 
    RowBox[{"1", "-", "alpha"}]]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Zexpr", "=", 
   RowBox[{"Ks", " ", "fak", " ", "mTimestep"}]}], ";"}]}], "Input",
 CellChangeTimes->{3.519317664515625*^9, 3.549780434484375*^9, 
  3.549856941265625*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"Zthetarot1", "==", "Zexpr"}], ",", "\[IndentingNewLine]", 
     RowBox[{"Zthetarot2", "==", "Zexpr"}], ",", "\[IndentingNewLine]", 
     RowBox[{"crot1", "==", "mrot1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"crot2", "==", "mrot2"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.519281698359375*^9, 3.5192817149375*^9}, {
  3.5719328762892303`*^9, 3.571932891156057*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"constantParameters", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{"{", 
     RowBox[{
     "alpha", ",", "0.3", ",", "double", ",", "\"\<\>\"", ",", 
      "\"\<numerical damping\>\""}], "}"}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{
  3.549780219859375*^9, {3.5719329023256764`*^9, 3.571932903339678*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"MechanicRotCnode", "[", 
      RowBox[{"mr1", ",", "0.", ",", "0.", ",", "\"\<mechanical node 1\>\""}],
       "]"}], ",", "\[IndentingNewLine]", 
     RowBox[{"MechanicRotCnode", "[", 
      RowBox[{"mr2", ",", "0.", ",", "0.", ",", "\"\<mechanical node 2\>\""}],
       "]"}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.519281679328125*^9, 3.519281686671875*^9}, {
  3.51931795584375*^9, 3.519318001453125*^9}, {3.519318130546875*^9, 
  3.519318136109375*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"cmr1", "==", 
      RowBox[{"tormr1", "-", 
       RowBox[{"Zexpr", " ", "wmr1"}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"cmr2", "==", 
      RowBox[{"tormr2", "-", 
       RowBox[{"Zexpr", " ", "wmr2"}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"cmr1f", "==", "tormr1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"cmr2f", "==", "tormr2"}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.51681842278125*^9, 3.516818476890625*^9}, 
   3.516818573890625*^9, {3.519289792671875*^9, 3.51928981996875*^9}, {
   3.5193177115625*^9, 3.51931777315625*^9}, {3.5719329086748877`*^9, 
   3.5719329248989162`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"localExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"cmr10", "==", 
      RowBox[{"cmr2", "+", 
       RowBox[{"2", " ", "Zexpr", " ", "wmr2"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"cmr20", "==", 
      RowBox[{"cmr1", "+", 
       RowBox[{"2", " ", "Zexpr", " ", "wmr1"}]}]}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.47858332371875*^9, 3.478583443984375*^9}, {
   3.478596512125*^9, 3.478596630296875*^9}, {3.47859673825*^9, 
   3.4785967756875*^9}, {3.478596964234375*^9, 3.478596992640625*^9}, 
   3.478597029796875*^9, {3.478600289875*^9, 3.47860030565625*^9}, {
   3.51582105284556*^9, 3.51582105678306*^9}, {3.5159004728175173`*^9, 
   3.515900475551874*^9}, {3.5159009659499717`*^9, 3.515900975043605*^9}, {
   3.5159024812862654`*^9, 3.5159025043018904`*^9}, {3.5167064051243*^9, 
   3.516706412796175*^9}, {3.516818175265625*^9, 3.51681819540625*^9}, {
   3.516818378453125*^9, 3.516818390015625*^9}, {3.5192897721875*^9, 
   3.51928977840625*^9}, {3.519317548234375*^9, 3.51931754925*^9}, {
   3.51931775690625*^9, 3.51931776296875*^9}, {3.571932929937725*^9, 
   3.5719329376597385`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"cmr1", "==", "cmr1f"}], ",", "\[IndentingNewLine]", 
     RowBox[{"cmr2", "==", "cmr2f"}], ",", "\[IndentingNewLine]", 
     RowBox[{"cmr1f", "==", 
      RowBox[{
       RowBox[{"alpha", " ", "cmr1f"}], " ", "+", 
       RowBox[{
        RowBox[{"(", 
         RowBox[{"1", "-", "alpha"}], ")"}], " ", "cmr10"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"cmr2f", "==", 
      RowBox[{
       RowBox[{"alpha", " ", "cmr2f"}], " ", "+", 
       RowBox[{
        RowBox[{"(", 
         RowBox[{"1", "-", "alpha"}], ")"}], " ", "cmr20"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"Zcmr1", "==", "Zexpr"}], ",", "\[IndentingNewLine]", 
     RowBox[{"Zcmr2", "==", "Zexpr"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.47858332371875*^9, 3.478583443984375*^9}, {
   3.478596512125*^9, 3.478596630296875*^9}, {3.47859673825*^9, 
   3.4785967756875*^9}, {3.478596964234375*^9, 3.478596992640625*^9}, 
   3.478597029796875*^9, {3.478600289875*^9, 3.47860030565625*^9}, {
   3.51582105284556*^9, 3.51582105678306*^9}, {3.5159004728175173`*^9, 
   3.515900475551874*^9}, {3.5159009659499717`*^9, 3.515900975043605*^9}, {
   3.5159024812862654`*^9, 3.5159025043018904`*^9}, {3.5167064051243*^9, 
   3.516706412796175*^9}, {3.516818200453125*^9, 3.5168182011875*^9}, {
   3.516818238359375*^9, 3.5168182486875*^9}, {3.51681829715625*^9, 
   3.516818360484375*^9}, 3.516818397609375*^9, {3.519289677296875*^9, 
   3.519289711046875*^9}, {3.5193175181875*^9, 3.5193175199375*^9}, {
   3.519317920234375*^9, 3.519317921890625*^9}, {3.571932940186943*^9, 
   3.57193295539697*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData["\<\"MechanicRotShaft.hpp\"\>"], "Print",
 CellChangeTimes->{3.5788167212443666`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\\\"typename\\\" \[Rule] \\\"MechanicRotShaft\\\"\\)\\), \
\\(\\(\\\"displayname\\\" \[Rule] \\(\\(\\\"Me\\\" \[Ellipsis] \
\\\"ft\\\"\\)\\)\\)\\)}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \
\\(\\({\\(\\(\\\"isopath\\\" \[Rule] \\\"MechanicRotShaft.svg\\\"\\)\\), \
\\(\\(\\\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \
\[Rule] \\\"MechanicRotShaft.svg\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \
\\(\\({}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\
\\\"x\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
0.3333333333333333`\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"Pmr1\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"Pmr2\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \
\\(\\({\\(\\(\\\"\\\" \[Ellipsis] \\\"n\\\"\\)\\) \[Rule] \\(\\(\\\"\\\" \
\[Ellipsis] \\\"\\\"\\)\\)}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \
\\(\\({\\(\\(\\\"isopath\\\" \[Rule] \\\"MechanicRotShaft.svg\\\"\\)\\), \
\\(\\(\\\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \
\[Rule] \\\"MechanicRotShaft.svg\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \
\\(\\({}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\
\\\"x\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
0.3333333333333333`\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"name\\\" \[Rule] \\\"Pmr1\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \\(\\(\
\[LeftSkeleton] 19 \[RightSkeleton]\\)\\)\\)\\), \\(\\(\\\"a\\\" \[Rule] \
\\\"0\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"Pmr2\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803386868591*^9, 3.575803588578483*^9, 
  3.575803656989483*^9, 3.575803757271483*^9, 3.575803796370483*^9, 
  3.57621279799975*^9, 3.5762130675186996`*^9, 3.577450703845433*^9, 
  3.5788167212463665`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803386868591*^9, 3.575803588578483*^9, 
  3.575803656989483*^9, 3.575803757271483*^9, 3.575803796370483*^9, 
  3.57621279799975*^9, 3.5762130675186996`*^9, 3.577450703845433*^9, 
  3.578816721247367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"y\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803386868591*^9, 3.575803588578483*^9, 
  3.575803656989483*^9, 3.575803757271483*^9, 3.575803796370483*^9, 
  3.57621279799975*^9, 3.5762130675186996`*^9, 3.577450703845433*^9, 
  3.578816721247367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803386868591*^9, 3.575803588578483*^9, 
  3.575803656989483*^9, 3.575803757271483*^9, 3.575803796370483*^9, 
  3.57621279799975*^9, 3.5762130675186996`*^9, 3.577450703845433*^9, 
  3.578816721248367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"y\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803386868591*^9, 3.575803588578483*^9, 
  3.575803656989483*^9, 3.575803757271483*^9, 3.575803796370483*^9, 
  3.57621279799975*^9, 3.5762130675186996`*^9, 3.577450703845433*^9, 
  3.5788167212493668`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803386868591*^9, 3.575803588578483*^9, 
  3.575803656989483*^9, 3.575803757271483*^9, 3.575803796370483*^9, 
  3.57621279799975*^9, 3.5762130675186996`*^9, 3.577450703845433*^9, 
  3.5788167212503667`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803386868591*^9, 3.575803588578483*^9, 
  3.575803656989483*^9, 3.575803757271483*^9, 3.575803796370483*^9, 
  3.57621279799975*^9, 3.5762130675186996`*^9, 3.577450703845433*^9, 
  3.5788167212513666`*^9}],

Cell[BoxData["\<\"MechanicRotShaft.xml\"\>"], "Output",
 CellChangeTimes->CompressedData["
1:eJxTTMoPSmVkYGBQZwCBcsMvQa8cGRokFkPoBffBNIPzewg/yvUrmL4syhkM
Ejf8wgemE3+IgulIVjEwLfiqMxxE13p0genlfhA6YRKYbtg7E8JvslkM5muH
g2mGHt4lYHory1KwuMSW5WDa33g1kH4VoJ1wCkjX8ZpNBtH7jt91PwOkQ9Z4
5gvEgfTFPV5VBFJ/QWM1mF5rA6GTAy6AaAaJKBD94lsSr2jNK0ePgzH7fZe8
ctzjP/kGiL5Wp/AQRG87t/ItiK5z7fkEov3MDywXXfrKsfNSwUkQreL+W7Jo
+StHI24NKd5VrxwB+XuLfA==
  "]]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["JLink", "Section",
 CellChangeTimes->{3.52179155325*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<JLink\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<Link with inertia\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"defaultPath", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.503905077842648*^9, 3.503905079842648*^9}, {
   3.5039103076641607`*^9, 3.5039103985397425`*^9}, {3.5039164662834997`*^9, 
   3.5039164750178747`*^9}, {3.5039165143772497`*^9, 
   3.5039165189397497`*^9}, {3.5041051675625*^9, 3.504105226359375*^9}, {
   3.507570546125*^9, 3.507570569546875*^9}, {3.507570601046875*^9, 
   3.50757067696875*^9}, 3.507796401609375*^9, {3.507887022343302*^9, 
   3.507887057967846*^9}, {3.5078871702320337`*^9, 3.507887175028847*^9}, {
   3.5082235454098396`*^9, 3.5082235597692146`*^9}, 3.5082237305660896`*^9, {
   3.512921352515625*^9, 3.512921388578125*^9}, {3.513708407234375*^9, 
   3.51370842740625*^9}, 3.513708469203125*^9, {3.5137087323125*^9, 
   3.513708733765625*^9}, {3.513708789984375*^9, 3.5137088199375*^9}, {
   3.513709315953125*^9, 3.5137093166875*^9}, {3.51370934803125*^9, 
   3.513709386875*^9}, 3.515393228397682*^9, 3.515394538846967*^9, {
   3.518675928359375*^9, 3.518675955546875*^9}, {3.518676036671875*^9, 
   3.518676042765625*^9}, {3.5194107155625*^9, 3.519410716421875*^9}, {
   3.521791503796875*^9, 3.521791549125*^9}, {3.52179232775*^9, 
   3.521792329390625*^9}, 3.5762130472586737`*^9}],

Cell[CellGroupData[{

Cell["Variables and parameters", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "  ", "=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "JL", ",", "1.", ",", "double", ",", "\"\<kgm2\>\"", ",", 
       "\"\<Equivalent inertia at node 2\>\""}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "BL", ",", "1.", ",", "double", ",", "\"\<Ns/rad\>\"", ",", 
       "\"\<Visc friction coeff. at node 2\>\""}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "link", ",", ".1", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Link length x1/sin(thetarot2)\>\""}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "x0", ",", ".1", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<x position for zero angle\>\""}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "theta0", ",", ".1", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<link angle for zero angle\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{"thetamin", ",", 
       RowBox[{"-", "1.05"}], ",", "double", ",", "\"\<rad\>\"", ",", 
       "\"\<Min angle\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "thetamax", ",", "1.05", ",", "double", ",", "\"\<rad\>\"", ",", 
       "\"\<Max angle\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.521792272390625*^9, 3.52179227240625*^9}, {
  3.5219819263125*^9, 3.521981953265625*^9}, {3.522432173046875*^9, 
  3.52243220875*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", "  ", "=", " ", 
   RowBox[{"{", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.521792276546875*^9, 3.5217922765625*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"MechanicQnode", "[", 
      RowBox[{"m1", ",", "0.", ",", "\"\<mechanical linear node 1\>\""}], 
      "]"}], ",", "\[IndentingNewLine]", 
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr2", ",", "0.", ",", "0.", ",", 
       "\"\<mechanical rotation node 2\>\""}], "]"}]}], "\[IndentingNewLine]",
     "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.521792288515625*^9, 3.52179228853125*^9}, {
   3.5217989671875*^9, 3.521798978421875*^9}, {3.52179901178125*^9, 
   3.5217990168125*^9}, 3.521799253921875*^9, 3.521799395453125*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[StyleBox["The system of equations",
 FontFamily->"Times"]], "Subsection",
 Evaluatable->False,
 PageBreakAbove->True],

Cell["\<\
The force balance equation, and integration of speed to postion\
\>", "Text"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"D", "[", 
  RowBox[{
   RowBox[{"link", " ", 
    RowBox[{"Sin", "[", 
     RowBox[{"theta", "[", "t", "]"}], "]"}]}], ",", "t"}], "]"}]], "Input"],

Cell[BoxData[
 RowBox[{"link", " ", 
  RowBox[{"Cos", "[", 
   RowBox[{"theta", "[", "t", "]"}], "]"}], " ", 
  RowBox[{
   SuperscriptBox["theta", "\[Prime]",
    MultilineFunction->None], "[", "t", "]"}]}]], "Output",
 CellChangeTimes->{
  3.4681691460625*^9, 3.52179240171875*^9, 3.5217925035625*^9, 
   3.521796445296875*^9, 3.521798214015625*^9, 3.52179902225*^9, 
   3.521799166484375*^9, 3.52179922765625*^9, 3.521799259078125*^9, 
   3.52179958165625*^9, {3.52180372590625*^9, 3.52180375115625*^9}, 
   3.52182699346875*^9, 3.5219132575625*^9, 3.52191331778125*^9, 
   3.521914143140625*^9, 3.5219150680625*^9, 3.521915123828125*^9, 
   3.521915201234375*^9, 3.52191554896875*^9, 3.521916142296875*^9, 
   3.52197054315625*^9, 3.522604981671875*^9, {3.522605896421875*^9, 
   3.522605913*^9}, 3.52260614646875*^9, 3.522636866617371*^9, 
   3.522636958124578*^9, 3.5226376384722977`*^9, 3.5331526536875*^9, 
   3.5331535625*^9, 3.5331540455625*^9, 3.53315417121875*^9, 
   3.53315486159375*^9, 3.5331954390625*^9, 3.533207459671875*^9, 
   3.533221827421875*^9, 3.53322193121875*^9, 3.535556433375*^9, 
   3.5355571883125*^9, 3.535557237953125*^9, 3.53555777975*^9, 
   3.535557838703125*^9, 3.535608295328125*^9, 3.5356085083125*^9, 
   3.53560996975*^9, 3.535611942015625*^9, 3.535617441109375*^9, 
   3.53562460678125*^9, 3.535688449666119*^9, 3.535688857798521*^9, 
   3.5356923510243835`*^9, 3.538977658505411*^9, 3.55471575538945*^9, 
   3.5762127980607567`*^9, 3.5762130675777054`*^9, 3.5774507039314423`*^9, 
   3.578816721321367*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"link", " ", 
  RowBox[{"Cos", "[", 
   RowBox[{"theta", "[", "t", "]"}], "]"}], " ", 
  RowBox[{
   SuperscriptBox["theta", "\[Prime]",
    MultilineFunction->None], "[", "t", "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{"link", " ", 
  RowBox[{"Cos", "[", 
   RowBox[{"theta", "[", "t", "]"}], "]"}], " ", 
  RowBox[{
   SuperscriptBox["theta", "\[Prime]",
    MultilineFunction->None], "[", "t", "]"}]}]], "Output",
 CellChangeTimes->{
  3.468169146078125*^9, 3.521792401734375*^9, 3.52179250359375*^9, 
   3.521796445328125*^9, 3.521798214046875*^9, 3.52179902228125*^9, 
   3.5217991665*^9, 3.5217992276875*^9, 3.521799259109375*^9, 
   3.5217995816875*^9, {3.521803725921875*^9, 3.5218037511875*^9}, 
   3.5218269935*^9, 3.52191325759375*^9, 3.521913317796875*^9, 
   3.521914143171875*^9, 3.521915068078125*^9, 3.52191512384375*^9, 
   3.521915201265625*^9, 3.521915549*^9, 3.5219161423125*^9, 
   3.5219705431875*^9, 3.522604981703125*^9, {3.522605896453125*^9, 
   3.522605913015625*^9}, 3.5226061465*^9, 3.5226368676634355`*^9, 
   3.5226369591706424`*^9, 3.5226376385973077`*^9, 3.533152653765625*^9, 
   3.5331535625625*^9, 3.533154046375*^9, 3.533154171296875*^9, 
   3.533154861671875*^9, 3.533195439125*^9, 3.533207459734375*^9, 
   3.533221827484375*^9, 3.533221931296875*^9, 3.535556433453125*^9, 
   3.535557188375*^9, 3.53555723803125*^9, 3.5355577798125*^9, 
   3.53555783878125*^9, 3.53560829540625*^9, 3.535608508375*^9, 
   3.535609969828125*^9, 3.535611942078125*^9, 3.5356174411875*^9, 
   3.53562460778125*^9, 3.5356884496817436`*^9, 3.53568885782977*^9, 
   3.5356923510400085`*^9, 3.538977658521036*^9, 3.554715755405072*^9, 
   3.5762127980837584`*^9, 3.5762130675977073`*^9, 3.577450703968446*^9, 
   3.578816721349367*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"vm1e", "=", 
   RowBox[{
    RowBox[{"-", "link"}], " ", 
    RowBox[{"Cos", "[", "thetamr2", "]"}], " ", "wmr2"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"thetaL", "=", 
  RowBox[{"thetamr2", "+", "theta0"}]}]}], "Input",
 CellChangeTimes->{{3.521792019890625*^9, 3.521792044546875*^9}, {
   3.521916404171875*^9, 3.52191640675*^9}, {3.52198187534375*^9, 
   3.521981907515625*^9}, 3.52198201184375*^9},
 FontWeight->"Plain"],

Cell[BoxData[
 RowBox[{"theta0", "+", "thetamr2"}]], "Output",
 CellChangeTimes->{
  3.52260498171875*^9, {3.522605896484375*^9, 3.522605913046875*^9}, 
   3.52260614653125*^9, 3.5226368677883387`*^9, 3.5226369592799325`*^9, 
   3.522637639941161*^9, 3.53315265384375*^9, 3.533153562625*^9, 
   3.533154046484375*^9, 3.533154171390625*^9, 3.53315486178125*^9, 
   3.5331954391875*^9, 3.53320745978125*^9, 3.533221827546875*^9, 
   3.533221931390625*^9, 3.53555643353125*^9, 3.53555718884375*^9, 
   3.53555723809375*^9, 3.535557779875*^9, 3.53555783884375*^9, 
   3.535608296265625*^9, 3.535608508515625*^9, 3.535609970765625*^9, 
   3.53561194215625*^9, 3.53561744125*^9, 3.53562460784375*^9, 
   3.5356884496973686`*^9, 3.535688858064142*^9, 3.535692351055634*^9, 
   3.538977658552286*^9, 3.5547157554363155`*^9, 3.5762127981087613`*^9, 
   3.5762130676187096`*^9, 3.577450703997449*^9, 3.578816721382367*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDA", " ", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"JL", " ", 
        RowBox[{"der", "[", " ", "wmr2", "]"}]}], " ", "+", " ", 
       RowBox[{"BL", " ", "wmr2"}]}], " ", "==", " ", 
      RowBox[{
       RowBox[{"fm1", " ", 
        RowBox[{"(", 
         RowBox[{"link", " ", 
          RowBox[{"Cos", "[", "thetamr2", "]"}]}], ")"}]}], " ", "-", " ", 
       "tormr2"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"JL", " ", 
        RowBox[{"der", "[", 
         RowBox[{"der", "[", "thetamr2", "]"}], "]"}]}], " ", "+", " ", 
       RowBox[{"BL", " ", "wmr2"}]}], " ", "==", " ", 
      RowBox[{
       RowBox[{"fm1", " ", 
        RowBox[{"(", 
         RowBox[{"link", " ", 
          RowBox[{"Cos", "[", "thetamr2", "]"}]}], ")"}]}], " ", "-", " ", 
       "tormr2"}]}]}], "\n", "\t", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5217922995625*^9, 3.521792299578125*^9}, {
   3.521796529671875*^9, 3.52179654959375*^9}, {3.521799128875*^9, 
   3.521799138171875*^9}, {3.52179941965625*^9, 3.521799425078125*^9}, {
   3.52182690634375*^9, 3.521826906796875*^9}, {3.521826940484375*^9, 
   3.52182694090625*^9}, {3.5218279221875*^9, 3.521827938953125*^9}, {
   3.52191376965625*^9, 3.521913787296875*^9}, {3.52191503640625*^9, 
   3.52191504615625*^9}, 3.52191512025*^9, {3.5219154718125*^9, 
   3.521915485875*^9}, {3.52198198196875*^9, 3.521981992953125*^9}, {
   3.52260609496875*^9, 3.52260610153125*^9}, {3.5719330624911575`*^9, 
   3.5719330754391804`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemBoundaryEquations", " ", "=", " ", 
   RowBox[{"{", "\n", "\t", 
    RowBox[{
     RowBox[{"fm1", "==", " ", 
      RowBox[{"cm1", " ", "+", " ", 
       RowBox[{"Zcm1", " ", "vm1e"}]}]}], ",", "\n", "\t", 
     RowBox[{"tormr2", " ", "==", " ", 
      RowBox[{"cmr2", " ", "+", " ", 
       RowBox[{"Zcmr2", " ", "wmr2"}]}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.521792304921875*^9, 3.52179231546875*^9}, {
  3.5217991398125*^9, 3.521799144390625*^9}, {3.52179943246875*^9, 
  3.521799447140625*^9}, {3.5719330846899967`*^9, 3.571933098683221*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", " ", "=", 
   RowBox[{"{", 
    RowBox[{"wmr2", ",", "thetamr2", ",", "fm1", ",", "tormr2"}], "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.52179189903125*^9, 3.521791937546875*^9}, {
  3.52179815940625*^9, 3.521798174921875*^9}, {3.52179914540625*^9, 
  3.52179915371875*^9}, {3.521799448046875*^9, 3.521799449734375*^9}, {
  3.5218037436875*^9, 3.52180374471875*^9}, {3.521915185*^9, 
  3.521915186875*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"vm1", "==", 
      RowBox[{
       RowBox[{"-", "link"}], " ", 
       RowBox[{"Cos", "[", "thetamr2", "]"}], " ", "wmr2"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"xm1", "==", 
      RowBox[{"x0", "-", 
       RowBox[{"link", " ", 
        RowBox[{"Sin", "[", "thetamr2", "]"}]}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"eqMassm1", "==", 
      FractionBox["JL", 
       SuperscriptBox[
        RowBox[{"(", 
         RowBox[{"link", " ", 
          RowBox[{"Cos", "[", "thetamr2", "]"}]}], ")"}], "2"]]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"eqInertiamr2", "==", "JL"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.521791780359375*^9, 3.521791796578125*^9}, {
  3.521791861109375*^9, 3.52179188821875*^9}, {3.521799158015625*^9, 
  3.5217991624375*^9}, {3.52179945103125*^9, 3.52179945225*^9}, {
  3.521827770453125*^9, 3.5218278778125*^9}, {3.521947617769854*^9, 
  3.521947619441675*^9}, {3.571933104112031*^9, 3.5719331199148583`*^9}}],

Cell[BoxData[
 RowBox[{"pi", "=."}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"variable2Limits", " ", "=", " ", 
   RowBox[{"{", 
    RowBox[{"{", 
     RowBox[{
     "thetamr2", ",", " ", "wmr2", ",", " ", "thetamin", ",", " ", 
      "thetamax"}], "}"}], "}"}]}], ";"}]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData["\<\"MechanicJLink.hpp\"\>"], "Print",
 CellChangeTimes->{3.5788167214963665`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(1, 1\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.578816721498367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(2, 1\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.578816721524367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(2, 2\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.578816721525367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Part :: \
partd\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.5788167215263667`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\\\"typename\\\" \[Rule] \\\"MechanicJLink\\\"\\)\\), \
\\(\\(\\(\\(\\\"di\\\" \[Ellipsis] \\\"me\\\"\\)\\) \[Rule] \\(\\(\\\"\\\" \
\[Ellipsis] \\\"\\\"\\)\\)\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"MechanicJLink.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \\\"MechanicJLink.svg\\\"\\)\
\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.3333333333333333`\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"Pm1\\\
\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0\
\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.6666666666666666`\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"Pmr2\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \\(\\(\
\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \
\\(\\({\\(\\(\\\"isopath\\\" \[Rule] \\\"MechanicJLink.svg\\\"\\)\\), \
\\(\\(\\\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \
\[Rule] \\\"MechanicJLink.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.3333333333333333`\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"Pm1\\\
\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0\
\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.6666666666666666`\\)\\), \\(\\(\
\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"Pmr2\
\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.578816721609367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.578816721610367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"y\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.5788167216113667`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.5788167216123667`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"y\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a \
valid value for an attribute in an XMLElement. The value of the attribute \
must be a string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.578816721613367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.5788167216143665`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.57621279819877*^9, 3.5762130677067184`*^9, 
  3.5774507041444635`*^9, 3.578816721615367*^9}],

Cell[BoxData["\<\"MechanicJLink.xml\"\>"], "Output",
 CellChangeTimes->{3.53315265696875*^9, 3.533153563921875*^9, 
  3.5331540480625*^9, 3.53315417296875*^9, 3.533154864703125*^9, 
  3.533195441015625*^9, 3.5332074610625*^9, 3.53322182928125*^9, 
  3.5332219330625*^9, 3.535556434515625*^9, 3.535557189796875*^9, 
  3.535557239046875*^9, 3.53555778121875*^9, 3.53555784021875*^9, 
  3.53560829721875*^9, 3.535608510234375*^9, 3.535609972625*^9, 
  3.535611943671875*^9, 3.53561744278125*^9, 3.535624608796875*^9, 
  3.535688449931737*^9, 3.5356888583141394`*^9, 3.535692351274387*^9, 
  3.538977659052286*^9, 3.554715755670639*^9, 3.576212798306781*^9, 
  3.57621306782373*^9, 3.577450704239473*^9, 3.578816721615367*^9}]
}, Open  ]]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["JLink2", "Section",
 CellChangeTimes->{3.52179155325*^9, 3.5261038711897683`*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<JLink2\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<Link with inertia\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"defaultPath", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.503905077842648*^9, 3.503905079842648*^9}, {
   3.5039103076641607`*^9, 3.5039103985397425`*^9}, {3.5039164662834997`*^9, 
   3.5039164750178747`*^9}, {3.5039165143772497`*^9, 
   3.5039165189397497`*^9}, {3.5041051675625*^9, 3.504105226359375*^9}, {
   3.507570546125*^9, 3.507570569546875*^9}, {3.507570601046875*^9, 
   3.50757067696875*^9}, 3.507796401609375*^9, {3.507887022343302*^9, 
   3.507887057967846*^9}, {3.5078871702320337`*^9, 3.507887175028847*^9}, {
   3.5082235454098396`*^9, 3.5082235597692146`*^9}, 3.5082237305660896`*^9, {
   3.512921352515625*^9, 3.512921388578125*^9}, {3.513708407234375*^9, 
   3.51370842740625*^9}, 3.513708469203125*^9, {3.5137087323125*^9, 
   3.513708733765625*^9}, {3.513708789984375*^9, 3.5137088199375*^9}, {
   3.513709315953125*^9, 3.5137093166875*^9}, {3.51370934803125*^9, 
   3.513709386875*^9}, 3.515393228397682*^9, 3.515394538846967*^9, {
   3.518675928359375*^9, 3.518675955546875*^9}, {3.518676036671875*^9, 
   3.518676042765625*^9}, {3.5194107155625*^9, 3.519410716421875*^9}, {
   3.521791503796875*^9, 3.521791549125*^9}, {3.52179232775*^9, 
   3.521792329390625*^9}, 3.5261038780023556`*^9, 3.5762130535233*^9}],

Cell[CellGroupData[{

Cell["Variables and parameters", "Subsection"],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "  ", "=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "JL", ",", "1.", ",", "double", ",", "\"\<kgm2\>\"", ",", 
       "\"\<Equivalent inertia at node 2\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "BL", ",", "1.", ",", "double", ",", "\"\<Ns/rad\>\"", ",", 
       "\"\<Visc friction coeff. at node 2\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "link", ",", ".1", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<Link length x1/sin(thetarot2)\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "x0", ",", ".1", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<x position for zero angle\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "theta0", ",", ".1", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<link angle for zero angle\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{"thetamin", ",", 
       RowBox[{"-", "1.05"}], ",", "double", ",", "\"\<rad\>\"", ",", 
       "\"\<Min angle\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "thetamax", ",", "1.05", ",", "double", ",", "\"\<rad\>\"", ",", 
       "\"\<Max angle\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.521792272390625*^9, 3.52179227240625*^9}, {
  3.5219819263125*^9, 3.521981953265625*^9}, {3.522432173046875*^9, 
  3.52243220875*^9}, {3.5261158462238398`*^9, 3.5261158513013473`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", "  ", "=", " ", 
   RowBox[{"{", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.521792276546875*^9, 3.5217922765625*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"MechanicQnode", "[", 
      RowBox[{"m0", ",", "0.", ",", "\"\<mechanical linear node 0\>\""}], 
      "]"}], ",", "\[IndentingNewLine]", 
     RowBox[{"MechanicQnode", "[", 
      RowBox[{"m1", ",", "0.", ",", "\"\<mechanical linear node 1\>\""}], 
      "]"}], ",", "\[IndentingNewLine]", 
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr2", ",", "0.", ",", "0.", ",", 
       "\"\<mechanical rotation node 2\>\""}], "]"}]}], "\[IndentingNewLine]",
     "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.521792288515625*^9, 3.52179228853125*^9}, {
   3.5217989671875*^9, 3.521798978421875*^9}, {3.52179901178125*^9, 
   3.5217990168125*^9}, 3.521799253921875*^9, 3.521799395453125*^9, {
   3.5261040069576063`*^9, 3.5261040111608124`*^9}, {3.526104546020048*^9, 
   3.526104553442113*^9}, 3.5261092376992793`*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[StyleBox["The system of equations",
 FontFamily->"Times"]], "Subsection",
 Evaluatable->False,
 PageBreakAbove->True],

Cell["\<\
The force balance equation, and integration of speed to postion\
\>", "Text"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"D", "[", 
  RowBox[{
   RowBox[{"link", " ", 
    RowBox[{"Sin", "[", 
     RowBox[{"theta", "[", "t", "]"}], "]"}]}], ",", "t"}], "]"}]], "Input"],

Cell[BoxData[
 RowBox[{"link", " ", 
  RowBox[{"Cos", "[", 
   RowBox[{"theta", "[", "t", "]"}], "]"}], " ", 
  RowBox[{
   SuperscriptBox["theta", "\[Prime]",
    MultilineFunction->None], "[", "t", "]"}]}]], "Output",
 CellChangeTimes->{
  3.4681691460625*^9, 3.52179240171875*^9, 3.5217925035625*^9, 
   3.521796445296875*^9, 3.521798214015625*^9, 3.52179902225*^9, 
   3.521799166484375*^9, 3.52179922765625*^9, 3.521799259078125*^9, 
   3.52179958165625*^9, {3.52180372590625*^9, 3.52180375115625*^9}, 
   3.52182699346875*^9, 3.5219132575625*^9, 3.52191331778125*^9, 
   3.521914143140625*^9, 3.5219150680625*^9, 3.521915123828125*^9, 
   3.521915201234375*^9, 3.52191554896875*^9, 3.521916142296875*^9, 
   3.52197054315625*^9, 3.522604981671875*^9, {3.522605896421875*^9, 
   3.522605913*^9}, 3.52260614646875*^9, 3.522636866617371*^9, 
   3.522636958124578*^9, 3.5226376384722977`*^9, 3.5261088369031854`*^9, 
   3.526109268058849*^9, 3.5261158860314984`*^9, 3.533152657921875*^9, 
   3.533153564796875*^9, 3.53315404890625*^9, 3.5331541738125*^9, 
   3.533154865515625*^9, 3.53319544184375*^9, 3.533207461859375*^9, 
   3.5332218301875*^9, 3.53322193396875*^9, 3.53555643509375*^9, 
   3.535557190328125*^9, 3.535557239578125*^9, 3.53555778175*^9, 
   3.535557840765625*^9, 3.5356082990625*^9, 3.5356085146875*^9, 
   3.535609974609375*^9, 3.535611944296875*^9, 3.53561744353125*^9, 
   3.535624610859375*^9, 3.535688449978611*^9, 3.535688858345389*^9, 
   3.5356923513212624`*^9, 3.5387285468384066`*^9, 3.538977659427286*^9, 
   3.554715755717504*^9, 3.5762127983627863`*^9, 3.576213067881736*^9, 
   3.5774507043544846`*^9, 3.578816721696367*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"link", " ", 
  RowBox[{"Cos", "[", 
   RowBox[{"theta", "[", "t", "]"}], "]"}], " ", 
  RowBox[{
   SuperscriptBox["theta", "\[Prime]",
    MultilineFunction->None], "[", "t", "]"}]}]], "Input"],

Cell[BoxData[
 RowBox[{"link", " ", 
  RowBox[{"Cos", "[", 
   RowBox[{"theta", "[", "t", "]"}], "]"}], " ", 
  RowBox[{
   SuperscriptBox["theta", "\[Prime]",
    MultilineFunction->None], "[", "t", "]"}]}]], "Output",
 CellChangeTimes->{
  3.468169146078125*^9, 3.521792401734375*^9, 3.52179250359375*^9, 
   3.521796445328125*^9, 3.521798214046875*^9, 3.52179902228125*^9, 
   3.5217991665*^9, 3.5217992276875*^9, 3.521799259109375*^9, 
   3.5217995816875*^9, {3.521803725921875*^9, 3.5218037511875*^9}, 
   3.5218269935*^9, 3.52191325759375*^9, 3.521913317796875*^9, 
   3.521914143171875*^9, 3.521915068078125*^9, 3.52191512384375*^9, 
   3.521915201265625*^9, 3.521915549*^9, 3.5219161423125*^9, 
   3.5219705431875*^9, 3.522604981703125*^9, {3.522605896453125*^9, 
   3.522605913015625*^9}, 3.5226061465*^9, 3.5226368676634355`*^9, 
   3.5226369591706424`*^9, 3.5226376385973077`*^9, 3.5261088369813113`*^9, 
   3.526109268074474*^9, 3.5261158860627446`*^9, 3.533152658015625*^9, 
   3.533153564875*^9, 3.533154049*^9, 3.533154173890625*^9, 
   3.533154865609375*^9, 3.53319544190625*^9, 3.53320746190625*^9, 
   3.533221830265625*^9, 3.5332219340625*^9, 3.535556435171875*^9, 
   3.535557190390625*^9, 3.53555723965625*^9, 3.5355577818125*^9, 
   3.53555784084375*^9, 3.535608299125*^9, 3.535608514765625*^9, 
   3.5356099746875*^9, 3.535611944375*^9, 3.53561744359375*^9, 
   3.535624610921875*^9, 3.5356884499942355`*^9, 3.5356888583766384`*^9, 
   3.5356923513368874`*^9, 3.5387285468540316`*^9, 3.538977659458536*^9, 
   3.5547157557331257`*^9, 3.576212798386789*^9, 3.576213067904738*^9, 
   3.577450704677517*^9, 3.5788167217253666`*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"vm1e", "=", 
   RowBox[{
    RowBox[{"-", "link"}], " ", 
    RowBox[{"Cos", "[", "thetamr2", "]"}], " ", "wmr2"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"thetaL", "=", 
  RowBox[{"thetamr2", "+", "theta0"}]}]}], "Input",
 CellChangeTimes->{{3.521792019890625*^9, 3.521792044546875*^9}, {
   3.521916404171875*^9, 3.52191640675*^9}, {3.52198187534375*^9, 
   3.521981907515625*^9}, 3.52198201184375*^9},
 FontWeight->"Plain"],

Cell[BoxData[
 RowBox[{"theta0", "+", "thetamr2"}]], "Output",
 CellChangeTimes->{
  3.52260498171875*^9, {3.522605896484375*^9, 3.522605913046875*^9}, 
   3.52260614653125*^9, 3.5226368677883387`*^9, 3.5226369592799325`*^9, 
   3.522637639941161*^9, 3.526108837012562*^9, 3.526109268090099*^9, 
   3.5261158860783677`*^9, 3.533152658640625*^9, 3.533153565046875*^9, 
   3.533154049078125*^9, 3.53315417396875*^9, 3.5331548656875*^9, 
   3.533195441984375*^9, 3.533207461953125*^9, 3.533221830328125*^9, 
   3.53322193415625*^9, 3.535556435234375*^9, 3.535557190453125*^9, 
   3.535557239734375*^9, 3.535557781875*^9, 3.53555784090625*^9, 
   3.5356082991875*^9, 3.535608515609375*^9, 3.535609975671875*^9, 
   3.53561194446875*^9, 3.535617443671875*^9, 3.53562461190625*^9, 
   3.5356884500098605`*^9, 3.5356888583922634`*^9, 3.535692351352513*^9, 
   3.538728546885281*^9, 3.538977659474161*^9, 3.554715755748747*^9, 
   3.5762127984087915`*^9, 3.5762130679257402`*^9, 3.577450704721521*^9, 
   3.578816721752367*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDa", " ", ":=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"JL", " ", 
        RowBox[{"der", "[", " ", "wmr2", "]"}]}], " ", "+", " ", 
       RowBox[{"BL", " ", "wmr2"}]}], " ", "==", " ", 
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{"fm0", "+", "fm1"}], ")"}], " ", 
        RowBox[{"(", 
         RowBox[{"link", " ", 
          RowBox[{"Cos", "[", "thetamr2", "]"}]}], ")"}]}], " ", "-", " ", 
       "tormr2"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"JL", " ", 
        RowBox[{"der", "[", 
         RowBox[{"der", "[", "thetamr2", "]"}], "]"}]}], " ", "+", " ", 
       RowBox[{"BL", " ", "wmr2"}]}], " ", "==", " ", 
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{"fm0", "+", "fm1"}], ")"}], " ", 
        RowBox[{"(", 
         RowBox[{"link", " ", 
          RowBox[{"Cos", "[", "thetamr2", "]"}]}], ")"}]}], " ", "-", " ", 
       "tormr2"}]}]}], "\n", "\t", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5217922995625*^9, 3.521792299578125*^9}, {
   3.521796529671875*^9, 3.52179654959375*^9}, {3.521799128875*^9, 
   3.521799138171875*^9}, {3.52179941965625*^9, 3.521799425078125*^9}, {
   3.52182690634375*^9, 3.521826906796875*^9}, {3.521826940484375*^9, 
   3.52182694090625*^9}, {3.5218279221875*^9, 3.521827938953125*^9}, {
   3.52191376965625*^9, 3.521913787296875*^9}, {3.52191503640625*^9, 
   3.52191504615625*^9}, 3.52191512025*^9, {3.5219154718125*^9, 
   3.521915485875*^9}, {3.52198198196875*^9, 3.521981992953125*^9}, {
   3.52260609496875*^9, 3.52260610153125*^9}, {3.5261087448868103`*^9, 
   3.526108755902506*^9}, {3.5719331546093197`*^9, 3.57193316086493*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemBoundaryEquations", " ", "=", " ", 
   RowBox[{"{", "\n", "\t", 
    RowBox[{
     RowBox[{"fm0", " ", "==", " ", 
      RowBox[{"cm0", "+", " ", 
       RowBox[{"Zcm0", " ", "vm1e"}]}]}], ",", "\n", "\t", 
     RowBox[{"fm1", " ", "==", " ", 
      RowBox[{"cm1", " ", "+", " ", 
       RowBox[{"Zcm1", " ", "vm1e"}]}]}], ",", "\n", "\t", 
     RowBox[{"tormr2", "==", " ", 
      RowBox[{"cmr2", " ", "+", " ", 
       RowBox[{"Zcmr2", " ", "wmr2"}]}]}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.521792304921875*^9, 3.52179231546875*^9}, {
  3.5217991398125*^9, 3.521799144390625*^9}, {3.52179943246875*^9, 
  3.521799447140625*^9}, {3.526104171554495*^9, 3.52610422402526*^9}, {
  3.526104366921372*^9, 3.526104395109935*^9}, {3.5261045364416776`*^9, 
  3.52610454101992*^9}, {3.5261060621936755`*^9, 3.5261060649124603`*^9}, {
  3.571933164156536*^9, 3.5719331783837614`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", " ", "=", 
   RowBox[{"{", 
    RowBox[{"wmr2", ",", "thetamr2", ",", "fm0", ",", "fm1", ",", "tormr2"}], 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.52179189903125*^9, 3.521791937546875*^9}, {
  3.52179815940625*^9, 3.521798174921875*^9}, {3.52179914540625*^9, 
  3.52179915371875*^9}, {3.521799448046875*^9, 3.521799449734375*^9}, {
  3.5218037436875*^9, 3.52180374471875*^9}, {3.521915185*^9, 
  3.521915186875*^9}, {3.526108666073806*^9, 3.5261086670425625`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"vm1", "==", 
      RowBox[{
       RowBox[{"-", "link"}], " ", 
       RowBox[{"Cos", "[", "thetamr2", "]"}], " ", "wmr2"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"vm0", "==", "vm1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"xm1", "==", 
      RowBox[{"x0", "-", 
       RowBox[{"link", " ", 
        RowBox[{"Sin", "[", "thetamr2", "]"}]}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"eqMassm1", "==", 
      FractionBox["JL", 
       SuperscriptBox[
        RowBox[{"(", 
         RowBox[{"link", " ", 
          RowBox[{"Cos", "[", "thetamr2", "]"}]}], ")"}], "2"]]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"eqMassm0", "==", "eqMassm1"}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqInertiamr2", "==", "JL"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.521791780359375*^9, 3.521791796578125*^9}, {
  3.521791861109375*^9, 3.52179188821875*^9}, {3.521799158015625*^9, 
  3.5217991624375*^9}, {3.52179945103125*^9, 3.52179945225*^9}, {
  3.521827770453125*^9, 3.5218278778125*^9}, {3.521947617769854*^9, 
  3.521947619441675*^9}, {3.5261053086438284`*^9, 3.526105317956507*^9}, {
  3.526106079022016*^9, 3.5261060887252655`*^9}, {3.57193318346937*^9, 
  3.5719332075402126`*^9}}],

Cell[BoxData[
 RowBox[{"pi", "=."}]], "Input"],

Cell[BoxData[
 RowBox[{
  RowBox[{"variable2Limits", " ", "=", " ", 
   RowBox[{"{", 
    RowBox[{"{", 
     RowBox[{
     "thetamr2", ",", " ", "wmr2", ",", " ", "thetamin", ",", " ", 
      "thetamax"}], "}"}], "}"}]}], ";"}]], "Input"],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData["\<\"MechanicJLink2.hpp\"\>"], "Print",
 CellChangeTimes->{3.578816722021367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Power", "::", "infy"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Infinite expression \[NoBreak]\\!\\(1\\/0\\)\[NoBreak] \
encountered. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/infy\\\", ButtonNote -> \
\\\"Power::infy\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.578816722023367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Power", "::", "infy"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Infinite expression \[NoBreak]\\!\\(1\\/0\\)\[NoBreak] \
encountered. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/infy\\\", ButtonNote -> \
\\\"Power::infy\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.578816722024367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"MechanicJLink2.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"MechanicJLink2.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.25`\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"Pm0\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\
\\(\\(\\\"x\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.5`\\)\\), \
\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\
\"Pm1\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0\
\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.75`\\)\\), \\(\\(\\\"a\\\" \[Rule] \
\\\"0\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"Pmr2\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \\(\\(\
\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\\(\\(\\(\\\"\\\" \
\[Ellipsis] \\\"e\\\"\\)\\) \[Rule] \\(\\(\\\"\\\" \[Ellipsis] \\\"\\\"\\)\\)\
\\)\\), \\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"MechanicJLink2.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \
\\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"MechanicJLink2.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \
\[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.25`\\)\\), \\(\\(\\\"a\\\" \
\[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"Pm0\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\)]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \
\\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.75`\
\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"Pmr2\\\"\\)\\)}\\)\\), \
\\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.578816722045367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.5788167220463667`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.25`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"y\\\" \[Rule] 0.25`\\)\[NoBreak] is not a valid value for \
an attribute in an XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.578816722047367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.5788167220483665`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.5`\\)\[NoBreak] in \[NoBreak]\\!\\(\\\"y\
\\\" \[Rule] 0.5`\\)\[NoBreak] is not a valid value for an attribute in an \
XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.578816722049367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Malformed symbolic XML expression encountered. This may \
result in unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.578816722050367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.578816722051367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"\[NoBreak]\\!\\(0.75`\\)\[NoBreak] in \
\[NoBreak]\\!\\(\\\"y\\\" \[Rule] 0.75`\\)\[NoBreak] is not a valid value for \
an attribute in an XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.578816722051367*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], 
  RowBox[{
  ":", " "}], "\<\"Further output of \
\[NoBreak]\\!\\(\\*StyleBox[\\(XMLElement :: attrhs\\), \
\\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this calculation. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/message/General/stop\\\", \
ButtonNote -> \\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.5762127985088015`*^9, 3.576213068011749*^9, 
  3.577450704919541*^9, 3.5788167220523667`*^9}],

Cell[BoxData["\<\"MechanicJLink2.xml\"\>"], "Output",
 CellChangeTimes->{3.53315266121875*^9, 3.533153567375*^9, 
  3.533154050953125*^9, 3.533154175828125*^9, 3.53315486765625*^9, 
  3.533195443890625*^9, 3.533207463875*^9, 3.533221832328125*^9, 
  3.533221936046875*^9, 3.53555643665625*^9, 3.53555719175*^9, 
  3.535557241125*^9, 3.53555778321875*^9, 3.53555784221875*^9, 
  3.53560830121875*^9, 3.53560851690625*^9, 3.535609977875*^9, 
  3.535611945859375*^9, 3.53561744546875*^9, 3.5356246140625*^9, 
  3.5356884503379765`*^9, 3.5356888588922567`*^9, 3.535692351633766*^9, 
  3.538728547291526*^9, 3.538977659927286*^9, 3.554715756139287*^9, 
  3.5762127985428047`*^9, 3.576213068055753*^9, 3.5774507049335423`*^9, 
  3.5788167220533667`*^9}]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Develop library", "Title",
 CellChangeTimes->{{3.5757937426152196`*^9, 3.575793775492507*^9}}],

Cell[CellGroupData[{

Cell["Mkload01D", "Section",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.519281468671875*^9, 3.519281469359375*^9}, 
   3.5226043241875*^9, 3.522604355609375*^9, 3.525534334828125*^9, 
   3.533225155609375*^9, 3.535557679125*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<Mkload01D\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<An inertia load with spring and damper\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of FLuid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFile", "[", 
   RowBox[{"domain", ",", "displayName"}], "]"}], ";"}]}], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.503905077842648*^9, 3.503905079842648*^9}, {
   3.5039103076641607`*^9, 3.5039103985397425`*^9}, {3.5039164662834997`*^9, 
   3.5039164750178747`*^9}, {3.5039165143772497`*^9, 
   3.5039165189397497`*^9}, {3.5041051675625*^9, 3.504105226359375*^9}, {
   3.507570546125*^9, 3.507570569546875*^9}, {3.507570601046875*^9, 
   3.50757067696875*^9}, 3.507796401609375*^9, {3.507887022343302*^9, 
   3.507887057967846*^9}, {3.5078871702320337`*^9, 3.507887175028847*^9}, {
   3.5082235454098396`*^9, 3.5082235597692146`*^9}, 3.5082237305660896`*^9, {
   3.512921352515625*^9, 3.512921388578125*^9}, 3.513861419*^9, 
   3.5226043241875*^9, 3.525534334828125*^9, 3.533225112109375*^9, 
   3.535557679125*^9}],

Cell[BoxData[
 RowBox[{"ResetComponentVariables", "[", "]"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{3.5226043241875*^9, 3.525534334828125*^9, 
  3.535557679125*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "  ", "=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "mL", ",", "1000.", ",", "double", ",", "\"\<kg\>\"", ",", 
       "\"\<Inertia\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "bL", ",", "10.", ",", "double", ",", "\"\<Ns/m\>\"", ",", 
       "\"\<Visc. friction coeff.\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "kL", ",", "10.", ",", "double", ",", "\"\<N/m\>\"", ",", 
       "\"\<Spring constant\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.519016849310559*^9, 3.5190168493261824`*^9}, 
   3.5226043241875*^9, 3.525534334828125*^9, 3.535557679125*^9, {
   3.5356921965096245`*^9, 3.53569219919709*^9}, {3.5719321491201143`*^9, 
   3.5719321601181335`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"MechanicQnode", "[", 
      RowBox[{"m1", ",", "0.", ",", "\"\<mechanical node 1\>\""}], "]"}], ",",
      "\[IndentingNewLine]", 
     RowBox[{"MechanicQnode", "[", 
      RowBox[{"m2", ",", "0.", ",", "\"\<mechanical node 2\>\""}], "]"}]}], 
    "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.51901685320086*^9, 3.519016853216484*^9}, {
   3.521913885921875*^9, 3.521913887859375*^9}, 3.5226043241875*^9, 
   3.525534334828125*^9, 3.535557679125*^9, {3.571932162551738*^9, 
   3.57193216922855*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{"xm1", "==", 
     RowBox[{"-", "xm2"}]}], "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{
  3.51901688034019*^9, {3.521913926984375*^9, 3.521913928296875*^9}, 
   3.522604324203125*^9, 3.525534334828125*^9, 3.535557679125*^9, {
   3.571932201021405*^9, 3.5719322130802264`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDA", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"mL", " ", 
        RowBox[{"Der", "[", "vm2", "]"}]}], "+", 
       RowBox[{"bL", " ", "vm2"}], "+", 
       RowBox[{"kL", " ", "xm2"}]}], "==", 
      RowBox[{"(", 
       RowBox[{"fm1", "-", "fm2"}], ")"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "xm2", "]"}], "==", " ", "vm2"}]}], 
    "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.52191389025*^9, 3.521913899796875*^9}, 
   3.5226043241875*^9, 3.5253431853125*^9, {3.525344901234375*^9, 
   3.525344916140625*^9}, 3.53322190715625*^9, 3.535557679125*^9, {
   3.571932173487357*^9, 3.5719321788849664`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemBoundaryEquations", " ", "=", " ", 
   RowBox[{"{", "\n", "\t", 
    RowBox[{
     RowBox[{"fm1", " ", "==", " ", 
      RowBox[{"cm1", " ", "-", " ", 
       RowBox[{"Zcm1", " ", "vm2"}]}]}], ",", "\n", "\t", 
     RowBox[{"fm2", " ", "==", " ", 
      RowBox[{"cm2", " ", "+", " ", 
       RowBox[{"Zcm2", " ", "vm2"}]}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.5190168632782354`*^9, 3.51901686329386*^9}, {
   3.52191390128125*^9, 3.52191391521875*^9}, {3.52194675112527*^9, 
   3.5219467526095877`*^9}, 3.5226043241875*^9, 3.525534334828125*^9, 
   3.535557679125*^9, {3.571932181334171*^9, 3.5719321950933948`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", " ", "=", " ", 
   RowBox[{"{", 
    RowBox[{"vm2", ",", " ", "xm2", ",", " ", "fm1", ",", " ", "fm2"}], 
    "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{
  3.522604324203125*^9, 3.525534334828125*^9, {3.5261037952044206`*^9, 
   3.5261037984857125`*^9}, 3.533154146171875*^9, {3.53555637615625*^9, 
   3.5355563779375*^9}, 3.535557679125*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"vm1", "==", 
      RowBox[{"-", "vm2"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"xm1", "==", 
      RowBox[{"-", "xm2"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqMassm1", "==", "mL"}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqMassm2", "==", "mL"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{
  3.519016887605582*^9, {3.5219138655625*^9, 3.52191387359375*^9}, {
   3.521913929390625*^9, 3.521913962359375*^9}, 3.522604324203125*^9, 
   3.525534334828125*^9, 3.535557679125*^9, {3.571932216621433*^9, 
   3.5719322342026634`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Compgen", "[", "file", "]"}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{3.5190168934960184`*^9, 3.522604324203125*^9, 
  3.525534334828125*^9, 3.535557679125*^9}]
}, Closed]],

Cell[CellGroupData[{

Cell["Mkload1D", "Section",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{{3.519281468671875*^9, 3.519281469359375*^9}, 
   3.5226043241875*^9, 3.522604355609375*^9, 3.525534334828125*^9, 
   3.533225155609375*^9, {3.535557679125*^9, 3.535557691484375*^9}, 
   3.571933669207423*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<Mkload1D\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<An inertia load with spring and damper\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of FLuid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFile", "[", 
   RowBox[{"domain", ",", "displayName"}], "]"}], ";"}]}], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{{3.503905077842648*^9, 3.503905079842648*^9}, {
   3.5039103076641607`*^9, 3.5039103985397425`*^9}, {3.5039164662834997`*^9, 
   3.5039164750178747`*^9}, {3.5039165143772497`*^9, 
   3.5039165189397497`*^9}, {3.5041051675625*^9, 3.504105226359375*^9}, {
   3.507570546125*^9, 3.507570569546875*^9}, {3.507570601046875*^9, 
   3.50757067696875*^9}, 3.507796401609375*^9, {3.507887022343302*^9, 
   3.507887057967846*^9}, {3.5078871702320337`*^9, 3.507887175028847*^9}, {
   3.5082235454098396`*^9, 3.5082235597692146`*^9}, 3.5082237305660896`*^9, {
   3.512921352515625*^9, 3.512921388578125*^9}, 3.513861419*^9, 
   3.5226043241875*^9, 3.525534334828125*^9, 3.533225112109375*^9, {
   3.535557679125*^9, 3.5355576933125*^9}, 3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{"ResetComponentVariables", "[", "]"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{3.5226043241875*^9, 3.525534334828125*^9, 
  3.535557679125*^9, 3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "  ", "=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "mL", ",", "1000.", ",", "double", ",", "\"\<kg\>\"", ",", 
       "\"\<Inertia\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "bL", ",", "10.", ",", "double", ",", "\"\<Ns/m\>\"", ",", 
       "\"\<Visc. friction coeff.\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "kL", ",", "10.", ",", "double", ",", "\"\<N/m\>\"", ",", 
       "\"\<Spring constant\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "xmin", ",", "0.", ",", "double", ",", "\"\<m\>\"", ",", 
       "\"\<Limitation on stroke\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "xmax", ",", "1.", ",", "double", ",", "\"\<m\>\"", ",", 
       "\"\<Limitation on stroke\>\""}], "}"}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{{3.519016849310559*^9, 3.5190168493261824`*^9}, 
   3.5226043241875*^9, 3.525534334828125*^9, 3.535557679125*^9, {
   3.571932261034711*^9, 3.5719322760731373`*^9}, 3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"MechanicQnode", "[", 
      RowBox[{"m1", ",", "0.", ",", "\"\<mechanical node 1\>\""}], "]"}], ",",
      "\[IndentingNewLine]", 
     RowBox[{"MechanicQnode", "[", 
      RowBox[{"m2", ",", "0.", ",", "\"\<mechanical node 2\>\""}], "]"}]}], 
    "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{{3.51901685320086*^9, 3.519016853216484*^9}, {
   3.521913885921875*^9, 3.521913887859375*^9}, 3.5226043241875*^9, 
   3.525534334828125*^9, 3.535557679125*^9, {3.5719322782727413`*^9, 
   3.5719322851523533`*^9}, 3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDA", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"mL", " ", 
        RowBox[{"Der", "[", "vm2", "]"}]}], "+", 
       RowBox[{"bL", " ", "vm2"}], "+", 
       RowBox[{"kL", " ", "xm2"}]}], "==", 
      RowBox[{"(", 
       RowBox[{"fm1", "-", "fm2"}], ")"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "xm2", "]"}], "==", " ", "vm2"}]}], 
    "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{{3.52191389025*^9, 3.521913899796875*^9}, 
   3.5226043241875*^9, 3.5253431853125*^9, {3.525344901234375*^9, 
   3.525344916140625*^9}, 3.53322190715625*^9, 3.535557679125*^9, {
   3.571932289520361*^9, 3.5719322940443687`*^9}, 3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDa", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"mL", " ", 
        RowBox[{"Der", "[", "vm2", "]"}]}], "+", 
       RowBox[{"bL", " ", "vm2"}], "+", 
       RowBox[{"kL", " ", "xm2"}]}], "==", 
      RowBox[{"(", 
       RowBox[{"fm1", "-", "fm2"}], ")"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{
       RowBox[{"mL", " ", 
        RowBox[{"Der", "[", 
         RowBox[{"Der", "[", "xm2", "]"}], "]"}]}], "+", 
       RowBox[{"bL", " ", 
        RowBox[{"Der", "[", " ", "xm2", "]"}]}], "+", 
       RowBox[{"kL", " ", "xm2"}]}], "==", 
      RowBox[{"(", 
       RowBox[{"fm1", "-", "fm2"}], ")"}]}]}], "\[IndentingNewLine]", "}"}]}],
   ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{{3.52191389025*^9, 3.521913899796875*^9}, 
   3.5226043241875*^9, {3.52553431665625*^9, 3.525534334828125*^9}, {
   3.52585894809375*^9, 3.5258590626875*^9}, {3.525859125296875*^9, 
   3.52585913021875*^9}, {3.52610349709123*^9, 3.5261034984037466`*^9}, {
   3.526103573076577*^9, 3.5261035904049244`*^9}, {3.5261037298910847`*^9, 
   3.5261037574539375`*^9}, 3.533154138703125*^9, {3.533195124390625*^9, 
   3.533195127421875*^9}, {3.535557085546875*^9, 3.535557094203125*^9}, {
   3.53555761753125*^9, 3.535557620578125*^9}, 3.535557679125*^9, 
   3.5356119035*^9, {3.5356158544375*^9, 3.53561587034375*^9}, {
   3.5719322984279766`*^9, 3.57193230065878*^9}, 3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"boundaryEquations", " ", "=", " ", 
   RowBox[{"{", "\n", "\t", 
    RowBox[{
     RowBox[{"fm1", " ", "==", " ", 
      RowBox[{"cm1", " ", "-", " ", 
       RowBox[{"Zcm1", " ", "vm2"}]}]}], ",", "\n", "\t", 
     RowBox[{"fm2", " ", "==", " ", 
      RowBox[{"cm2", " ", "+", " ", 
       RowBox[{"Zcm2", " ", "vm2"}]}]}]}], "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{{3.5190168632782354`*^9, 3.51901686329386*^9}, {
   3.52191390128125*^9, 3.52191391521875*^9}, {3.52194675112527*^9, 
   3.5219467526095877`*^9}, 3.5226043241875*^9, 3.525534334828125*^9, 
   3.535557679125*^9, {3.571932303513585*^9, 3.571932309659996*^9}, 
   3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", " ", "=", " ", 
   RowBox[{"{", 
    RowBox[{"vm2", ",", " ", "xm2", ",", " ", "fm1", ",", " ", "fm2"}], 
    "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{
  3.522604324203125*^9, 3.525534334828125*^9, {3.5261037952044206`*^9, 
   3.5261037984857125`*^9}, 3.533154146171875*^9, {3.53555637615625*^9, 
   3.5355563779375*^9}, 3.535557679125*^9, 3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{"xm1", "==", 
     RowBox[{"-", "xm2"}]}], "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{
  3.51901688034019*^9, {3.521913926984375*^9, 3.521913928296875*^9}, 
   3.522604324203125*^9, 3.525534334828125*^9, 3.535557679125*^9, {
   3.5719323133260026`*^9, 3.5719323219060173`*^9}, 3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"vm1", "==", 
      RowBox[{"-", "vm2"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"xm1", "==", 
      RowBox[{"-", "xm2"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqMassm1", "==", "mL"}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqMassm2", "==", "mL"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{
  3.519016887605582*^9, {3.5219138655625*^9, 3.52191387359375*^9}, {
   3.521913929390625*^9, 3.521913962359375*^9}, 3.522604324203125*^9, 
   3.525534334828125*^9, 3.535557679125*^9, {3.5719323268356266`*^9, 
   3.5719323434340553`*^9}, 3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"variable2Limits", " ", "=", " ", 
   RowBox[{"{", 
    RowBox[{"{", 
     RowBox[{"xm2", ",", " ", "vm2", ",", " ", "xmin", ",", " ", "xmax"}], 
     "}"}], "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{3.525452677828125*^9, 3.535557679125*^9, 
  3.571933669207423*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Compgen", "[", "file", "]"}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.},
 CellChangeTimes->{3.5190168934960184`*^9, 3.522604324203125*^9, 
  3.525534334828125*^9, 3.535557679125*^9, 3.571933669207423*^9}]
}, Closed]],

Cell[CellGroupData[{

Cell["Gear", "Section",
 CellChangeTimes->{{3.51923891821875*^9, 3.5192389314375*^9}, {
  3.519239495390625*^9, 3.519239499625*^9}}],

Cell[CellGroupData[{

Cell["Component description", "Subsection"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<Gear\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<This is a gear\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFile", "[", 
   RowBox[{"domain", ",", "displayName"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.5137112151875*^9, 3.513711217109375*^9}, {
   3.51378596903125*^9, 3.513785980671875*^9}, 3.515394539753217*^9, {
   3.515775693875*^9, 3.5157757050625*^9}, {3.517048046727305*^9, 
   3.51704806093043*^9}, 3.51707206725*^9, {3.5176530686834764`*^9, 
   3.51765311057437*^9}, {3.517673126703125*^9, 3.517673126796875*^9}, {
   3.5177214423487377`*^9, 3.517721453114225*^9}, {3.5177222281793466`*^9, 
   3.517722236008023*^9}, {3.519239243140625*^9, 3.519239249203125*^9}, {
   3.571932631082961*^9, 3.5719326329549637`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "Jg", ",", "1.", ",", "double", ",", "\"\<kg\>\"", ",", 
       "\"\<Equivalent inertia at port 2\>\""}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "Bg", ",", "0.", ",", "double", ",", "\"\<Ns/m\>\"", ",", 
       "\"\<Visc friction coeff. at port 2\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "myfric", ",", ".01", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<friction. coeff. of gear (at output)\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "wc", ",", "1.", ",", "double", ",", "\"\<rad/s\>\"", ",", 
       "\"\<Friction speed (for numerics)\>\""}], "}"}]}], 
    "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5177223027002172`*^9, 3.5177223072630386`*^9}, 
   3.5177223927213974`*^9, {3.5177288124589844`*^9, 3.5177288192870655`*^9}, {
   3.519192018484375*^9, 3.5191920904375*^9}, {3.6065544856132545`*^9, 
   3.6065544877322545`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{"{", 
     RowBox[{
     "gearRatio", ",", "1.", ",", "double", ",", "\"\<\>\"", ",", 
      "\"\<gearing wmr1/wmr2\>\""}], "}"}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.51879195675*^9, 3.51879195675*^9}, {
   3.5188418205557637`*^9, 3.5188418228369703`*^9}, 3.5191918769375*^9, {
   3.519191990234375*^9, 3.519191990515625*^9}, 3.51919202534375*^9, 
   3.519237145265625*^9, {3.519239074625*^9, 3.5192390884375*^9}, 
   3.519239290078125*^9, 3.5719326731250343`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr1", ",", "0.", ",", "0.", ",", 
       "\"\<mechanical rotation node 1\>\""}], "]"}], ",", 
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr2", ",", "0.", ",", "0.", ",", 
       "\"\<mechanical rotation node 2\>\""}], "]"}]}], "\[IndentingNewLine]",
     "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.517722088982048*^9, 3.5177221000453267`*^9}, {
   3.5177226071005135`*^9, 3.51772269952388*^9}, {3.517728739896949*^9, 
   3.517728741256315*^9}, {3.5177288566774516`*^9, 3.517728859177436*^9}, {
   3.51811161153125*^9, 3.518111612828125*^9}, {3.5187902193125*^9, 
   3.51879021984375*^9}, 3.518796081296875*^9, {3.52178083409375*^9, 
   3.52178083515625*^9}, 3.571932675106238*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Tfr", "=", 
   RowBox[{
    RowBox[{"(", 
     RowBox[{"myfric", " ", "tormr2"}], ")"}], " ", 
    RowBox[{"limit", "[", " ", 
     RowBox[{
      RowBox[{"wmr2", "/", " ", "wc"}], ",", 
      RowBox[{"-", "1."}], ",", "1."}], "]"}]}]}], ";"}]], "Input",
 CellChangeTimes->{
  3.51911504184375*^9, {3.51911515415625*^9, 3.51911516159375*^9}, {
   3.51911523025*^9, 3.519115245296875*^9}, 3.519115521796875*^9, {
   3.51911561315625*^9, 3.519115638296875*^9}, 3.519115712546875*^9, 
   3.51911581653125*^9, 3.519191794984375*^9, 3.51919189125*^9, 
   3.519191924734375*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDa", ":=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"Jg", " ", 
        RowBox[{"Der", "[", "wmr2", "]"}]}], "+", 
       RowBox[{"Bg", " ", "wmr2"}], "+", "Tfr"}], "==", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"gearRatio", " ", "tormr1"}], "-", "tormr2"}], ")"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr2", "]"}], "==", "wmr2"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr1", "]"}], "\[Equal]", 
      RowBox[{
       RowBox[{"-", "gearRatio"}], " ", "wmr2"}]}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5177219982634974`*^9, 3.5177220614345636`*^9}, 
   3.5177223966277223`*^9, {3.5177281220102787`*^9, 3.517728126182127*^9}, {
   3.5191918265*^9, 3.519191848109375*^9}, {3.5719326407705774`*^9, 
   3.5719326469793887`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"boundaryEquations", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"tormr1", "==", 
      RowBox[{"cmr1", "-", 
       RowBox[{"Zcmr1", " ", "gearRatio", " ", "wmr2"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"tormr2", "==", 
      RowBox[{"cmr2", "+", 
       RowBox[{"Zcmr2", " ", "wmr2"}]}]}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.517721974435677*^9, 3.517721983466811*^9}, {
   3.517738409847971*^9, 3.5177384690350924`*^9}, {3.517738575050039*^9, 
   3.517738580612503*^9}, 3.51919185296875*^9, {3.51923930296875*^9, 
   3.519239304890625*^9}, {3.5719326524861984`*^9, 3.571932660208212*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"wmr1", "==", 
      RowBox[{
       RowBox[{"-", "gearRatio"}], " ", "wmr2"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"eqInertiamr1", "==", 
      FractionBox["Jg", 
       SuperscriptBox["gearRatio", "2"]]}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqInertiamr2", "==", "Jg"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{
  3.517721656955366*^9, {3.517721741704281*^9, 3.517721748547943*^9}, 
   3.5177222002242537`*^9, 3.5191918551875*^9, {3.571932663811818*^9, 
   3.571932668117426*^9}, 3.6065546054112544`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", "=", 
   RowBox[{"{", 
    RowBox[{
    "wmr2", ",", "thetamr2", ",", "thetamr1", ",", "tormr1", ",", "tormr2"}], 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.517728154744444*^9, 3.5177282181034136`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], ":", 
  " ", "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(1, 1\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.554715754827073*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], ":", 
  " ", "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(2, 1\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.554715754827073*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], ":", 
  " ", "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(3, 1\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.554715754827073*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], ":", 
  " ", "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Part :: \
partd\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.554715754827073*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\\\"typename\\\" \[Rule] \\\"MechanicGear\\\"\\)\\), \
\\(\\(\\\"displayname\\\" \[Rule] \\\"MechanicGear\\\"\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"MechanicGear.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \\\
\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"MechanicGear.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\)]\\)\\)}\\)\\)\
\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \
\\(\\({\\\"version\\\" \[Rule] \\\"0.1\\\"}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\({\\(\\(\\\"typename\\\" \
\[Rule] \\\"MechanicGear\\\"\\)\\), \\(\\(\\\"displayname\\\" \[Rule] \
\\\"MechanicGear\\\"\\)\\)}\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"MechanicGear.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \[Rule] \\\
\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"MechanicGear.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(\
\[LeftSkeleton] 1 \[RightSkeleton]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\
\[NoBreak] is not a list of contents. The third item in an XMLElement must be \
a list of contents, even if it is an empty list. \\!\\(\\*ButtonBox[\\\"\
\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.5547157548426943`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], ":", 
  " ", "\<\"Malformed symbolic XML expression encountered. This may result in \
unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.5547157548426943`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \[NoBreak]\\!\
\\(\\\"y\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a valid value \
for an attribute in an XMLElement. The value of the attribute must be a \
string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.5547157548426943`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], ":", 
  " ", "\<\"Malformed symbolic XML expression encountered. This may result in \
unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.5547157548426943`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \[NoBreak]\\!\
\\(\\\"y\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a valid value \
for an attribute in an XMLElement. The value of the attribute must be a \
string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.5547157548426943`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], ":", 
  " ", "\<\"Malformed symbolic XML expression encountered. This may result in \
unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.5547157548426943`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], ":", 
  " ", "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.5547157548426943`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(0.5`\\)\[NoBreak] in \[NoBreak]\\!\\(\\\"x\\\" \
\[Rule] 0.5`\\)\[NoBreak] is not a valid value for an attribute in an \
XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.5547157548426943`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], ":", 
  " ", "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(XMLElement :: \
attrhs\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.519194284890625*^9, 3.519194354234375*^9, 3.51920168140625*^9, 
   3.5192017116875*^9, 3.519201758296875*^9, 3.51920179084375*^9, 
   3.519233515765625*^9, 3.51923715109375*^9, 3.51923738428125*^9, 
   3.51923766396875*^9, 3.519237761609375*^9, 3.5192386790625*^9, 
   3.51923873896875*^9, 3.5192400305625*^9, 3.5226049806875*^9, {
   3.522605895765625*^9, 3.522605912171875*^9}, 3.522606145671875*^9, 
   3.53315264821875*^9, 3.5331535584375*^9, 3.533154043171875*^9, 
   3.533154168265625*^9, 3.53315485378125*^9, 3.533195436890625*^9, 
   3.53320745559375*^9, 3.533221824890625*^9, 3.53322192896875*^9, 
   3.53555643059375*^9, 3.53555718590625*^9, 3.53555723578125*^9, 
   3.535557777609375*^9, 3.53555783646875*^9, 3.53560829025*^9, 
   3.535608500765625*^9, 3.535609962125*^9, 3.535611940015625*^9, 
   3.535617439125*^9, 3.535624594703125*^9, 3.535688449088009*^9, 
   3.535688857407901*^9, 3.5356923506962547`*^9, 3.538977657567911*^9, 
   3.5547157548426943`*^9}],

Cell[BoxData["\<\"MechanicGear.xml\"\>"], "Output",
 CellChangeTimes->{3.533152648375*^9, 3.53315355853125*^9, 
  3.533154043359375*^9, 3.5331541684375*^9, 3.533154854234375*^9, 
  3.53319543703125*^9, 3.53320745575*^9, 3.533221825015625*^9, 
  3.53322192915625*^9, 3.5355564306875*^9, 3.535557186296875*^9, 
  3.535557235921875*^9, 3.53555777775*^9, 3.535557836625*^9, 
  3.535608290359375*^9, 3.535608501*^9, 3.53560996253125*^9, 
  3.535611940203125*^9, 3.5356174393125*^9, 3.53562459484375*^9, 
  3.535688449119258*^9, 3.535688857454775*^9, 3.5356923507275047`*^9, 
  3.538977657599161*^9, 3.5547157548426943`*^9}]
}, Open  ]]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[{
 "GearClutch\n",
 StyleBox["Gear connected with a clutch",
  FontSize->16]
}], "Section",
 CellChangeTimes->{{3.51923891821875*^9, 3.5192389314375*^9}, {
  3.52260437209375*^9, 3.522604381546875*^9}, {3.5719332667423162`*^9, 
  3.57193327444873*^9}}],

Cell[CellGroupData[{

Cell["Component description", "Subsection"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<GearClutch\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<This is a combined clutch and gear\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFile", "[", 
   RowBox[{"domain", ",", "displayName"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.5137112151875*^9, 3.513711217109375*^9}, {
   3.51378596903125*^9, 3.513785980671875*^9}, 3.515394539753217*^9, {
   3.515775693875*^9, 3.5157757050625*^9}, {3.517048046727305*^9, 
   3.51704806093043*^9}, 3.51707206725*^9, {3.5176530686834764`*^9, 
   3.51765311057437*^9}, {3.517673126703125*^9, 3.517673126796875*^9}, {
   3.5177214423487377`*^9, 3.517721453114225*^9}, {3.5177222281793466`*^9, 
   3.517722236008023*^9}, {3.5209603293125*^9, 3.520960329578125*^9}, 
   3.521782180515625*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "Jg", ",", "1.", ",", "double", ",", "\"\<kg\>\"", ",", 
       "\"\<Equivalent inertia at port 2\>\""}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "Bg", ",", "0.", ",", "double", ",", "\"\<Ns/m\>\"", ",", 
       "\"\<Visc friction coeff. at port 2\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "myfric", ",", ".01", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<friction. coeff. of gear (at output)\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "wc", ",", "1.", ",", "double", ",", "\"\<rad/s\>\"", ",", 
       "\"\<Friction speed (for numerics)\>\""}], "}"}]}], 
    "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5177223027002172`*^9, 3.5177223072630386`*^9}, 
   3.5177223927213974`*^9, {3.5177288124589844`*^9, 3.5177288192870655`*^9}, {
   3.519192018484375*^9, 3.5191920904375*^9}, {3.550729794796875*^9, 
   3.55072979915625*^9}, {3.6065544930052547`*^9, 3.6065544942132545`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "gearRatio", ",", "1.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<gearing wmr1/wmr2\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "tmax", ",", "500.", ",", "double", ",", "\"\<Nm\>\"", ",", 
       "\"\<Max torque\>\""}], "}"}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.51879195675*^9, 3.51879195675*^9}, {
   3.5188418205557637`*^9, 3.5188418228369703`*^9}, 3.5191918769375*^9, {
   3.519191990234375*^9, 3.519191990515625*^9}, 3.51919202534375*^9, 
   3.519237145265625*^9, {3.519239074625*^9, 3.5192390884375*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr1", ",", "0.", ",", "0.", ",", 
       "\"\<mechanical rotation node 1\>\""}], "]"}], ",", 
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr2", ",", "0.", ",", "0.", ",", 
       "\"\<mechanical rotation node 2\>\""}], "]"}]}], "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.517722088982048*^9, 3.5177221000453267`*^9}, {
   3.5177226071005135`*^9, 3.51772269952388*^9}, {3.517728739896949*^9, 
   3.517728741256315*^9}, {3.5177288566774516`*^9, 3.517728859177436*^9}, {
   3.51811161153125*^9, 3.518111612828125*^9}, {3.5187902193125*^9, 
   3.51879021984375*^9}, 3.518796081296875*^9, {3.521780838296875*^9, 
   3.52178083940625*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Tfr", "=", 
   RowBox[{
    RowBox[{"(", 
     RowBox[{"myfric", " ", 
      RowBox[{"Abs", "[", "tormr2", "]"}]}], ")"}], " ", 
    RowBox[{"limit", "[", " ", 
     RowBox[{
      RowBox[{"wmr2", "/", " ", "wc"}], ",", 
      RowBox[{"-", "1."}], ",", "1."}], "]"}]}]}], ";"}]], "Input",
 CellChangeTimes->{
  3.51911504184375*^9, {3.51911515415625*^9, 3.51911516159375*^9}, {
   3.51911523025*^9, 3.519115245296875*^9}, 3.519115521796875*^9, {
   3.51911561315625*^9, 3.519115638296875*^9}, 3.519115712546875*^9, 
   3.51911581653125*^9, 3.519191794984375*^9, 3.51919189125*^9, 
   3.519191924734375*^9, {3.5507445151875*^9, 3.5507445209375*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Tg", "=", 
   RowBox[{"(", 
    RowBox[{
     RowBox[{"gearRatio", " ", "tormr1"}], "+", "tormr2"}], ")"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.550726511265625*^9, 3.550726529125*^9}, {
  3.550727061046875*^9, 3.5507270635*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDa", ":=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"Jg", " ", 
        RowBox[{"Der", "[", "wmr2", "]"}]}], "+", 
       RowBox[{"Bg", " ", "wmr2"}], "+", "Tfr"}], "==", 
      RowBox[{"(", 
       RowBox[{
        RowBox[{"gearRatio", " ", "tormr1"}], "-", "tormr2"}], ")"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr2", "]"}], "==", "wmr2"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr1", "]"}], "\[Equal]", 
      RowBox[{
       RowBox[{"-", "gearRatio"}], " ", "wmr2"}]}]}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5177219982634974`*^9, 3.5177220614345636`*^9}, 
   3.5177223966277223`*^9, {3.5177281220102787`*^9, 3.517728126182127*^9}, {
   3.5191918265*^9, 3.519191848109375*^9}, {3.5719326407705774`*^9, 
   3.5719326469793887`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDA", ":=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{"Jg", " ", 
        RowBox[{"Der", "[", "wmr2", "]"}]}], "+", 
       RowBox[{"Bg", " ", "wmr2"}], "+", "Tfr"}], "==", "Tg"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr2", "]"}], "==", "wmr2"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "thetamr1", "]"}], "\[Equal]", 
      RowBox[{
       RowBox[{"-", "gearRatio"}], " ", "wmr2"}]}]}], "\[IndentingNewLine]", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5177219982634974`*^9, 3.5177220614345636`*^9}, 
   3.5177223966277223`*^9, {3.5177281220102787`*^9, 3.517728126182127*^9}, {
   3.5191918265*^9, 3.519191848109375*^9}, {3.550558095859375*^9, 
   3.55055813553125*^9}, 3.550726445296875*^9, 3.550726507125*^9, 
   3.550726804953125*^9, {3.57193268744586*^9, 3.5719326993381195`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemBoundaryEquations", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"tormr1", "==", 
      RowBox[{"cmr1", "-", 
       RowBox[{"Zcmr1", " ", "gearRatio", " ", "wmr2"}]}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"tormr2", "==", 
      RowBox[{"cmr2", "+", 
       RowBox[{"Zcmr2", " ", "wmr2"}]}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.517721974435677*^9, 3.517721983466811*^9}, {
   3.517738409847971*^9, 3.5177384690350924`*^9}, {3.517738575050039*^9, 
   3.517738580612503*^9}, 3.51919185296875*^9, {3.5505581591875*^9, 
   3.550558165390625*^9}, {3.5719327043301287`*^9, 3.5719327498042088`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"wmr1", "==", 
      RowBox[{
       RowBox[{"-", "gearRatio"}], " ", "wmr2"}]}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"eqInertiamr1", "==", 
      FractionBox["Jg", 
       SuperscriptBox["gearRatio", "2"]]}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqInertiamr2", "==", "Jg"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{
  3.517721656955366*^9, {3.517721741704281*^9, 3.517721748547943*^9}, 
   3.5177222002242537`*^9, 3.5191918551875*^9, {3.521913991796875*^9, 
   3.5219140115*^9}, {3.571932718120553*^9, 3.5719327357953835`*^9}, {
   3.606554554921254*^9, 3.6065545806732545`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"variableLimits", "=", 
   RowBox[{"{", 
    RowBox[{"{", 
     RowBox[{"tormr1", ",", 
      RowBox[{"-", "tmax"}], ",", "tmax"}], "}"}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.55055796390625*^9, 3.5505580105*^9}, {
   3.550558184609375*^9, 3.5505582028125*^9}, {3.55055829021875*^9, 
   3.55055834353125*^9}, 3.550726474515625*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", "=", 
   RowBox[{"{", 
    RowBox[{
    "wmr2", ",", "thetamr2", ",", "thetamr1", ",", "tormr1", ",", "tormr2"}], 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.517728154744444*^9, 3.5177282181034136`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData["\<\"MechanicGearClutch.xml\"\>"], "Output",
 CellChangeTimes->{3.550726992484375*^9, 3.550727071*^9, 
  3.5547157549989104`*^9}]
}, Open  ]]
}, Open  ]]
}, Open  ]],

Cell[CellGroupData[{

Cell[TextData[StyleBox["ScrewActuator",
 FontFamily->"System"]], "Section",
 Evaluatable->False,
 CellChangeTimes->{
  3.522604736109375*^9, 3.52260476665625*^9, {3.5375221220952315`*^9, 
   3.5375221278764815`*^9}, {3.537869482578125*^9, 3.53786948590625*^9}, {
   3.563791226294585*^9, 3.563791259092865*^9}}],

Cell["Electric motor with gear and inertia load", "Text",
 CellChangeTimes->{{3.522604737421875*^9, 3.522604750875*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<ScrewActuator\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "brief", "=", "\"\<Electric motor with screw, link and inertia load\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFile", "[", 
   RowBox[{"domain", ",", "displayName"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.503905077842648*^9, 3.503905079842648*^9}, {
   3.5039103076641607`*^9, 3.5039103985397425`*^9}, {3.5039164662834997`*^9, 
   3.5039164750178747`*^9}, {3.5039165143772497`*^9, 
   3.5039165189397497`*^9}, {3.5041051675625*^9, 3.504105226359375*^9}, {
   3.507570546125*^9, 3.507570569546875*^9}, {3.507570601046875*^9, 
   3.50757067696875*^9}, 3.507796401609375*^9, {3.507887022343302*^9, 
   3.507887057967846*^9}, {3.5078871702320337`*^9, 3.507887175028847*^9}, {
   3.5082235454098396`*^9, 3.5082235597692146`*^9}, 3.5082237305660896`*^9, {
   3.512921352515625*^9, 3.512921388578125*^9}, {3.513708407234375*^9, 
   3.51370842740625*^9}, 3.513708469203125*^9, {3.5137087323125*^9, 
   3.513708733765625*^9}, {3.513708789984375*^9, 3.5137088199375*^9}, {
   3.513709315953125*^9, 3.5137093166875*^9}, {3.51370934803125*^9, 
   3.513709386875*^9}, 3.515393228397682*^9, 3.515394538846967*^9, {
   3.521777776703125*^9, 3.521777777328125*^9}, {3.5375221420014815`*^9, 
   3.5375221550639815`*^9}, {3.537869450671875*^9, 3.53786947475*^9}, 
   3.550745776859375*^9, {3.563791236413597*^9, 3.563791265157471*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", "\t", 
    RowBox[{
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr0", ",", "0.", ",", "0.", ",", "\"\<Mechanical rot.connection\>\""}],
       "]"}], ",", "\[IndentingNewLine]", "\t", 
     RowBox[{"MechanicRotQnode", "[", 
      RowBox[{
      "mr1", ",", "0.", ",", "0.", ",", "\"\<Mechanical rot.connection\>\""}],
       "]"}]}], "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{
  3.51371110959375*^9, {3.515486897105438*^9, 3.5154868972460594`*^9}, {
   3.5154963499562235`*^9, 3.5154963505968523`*^9}, {3.515525281796875*^9, 
   3.515525324359375*^9}, {3.515560997171875*^9, 3.51556103534375*^9}, {
   3.515685350796875*^9, 3.51568536184375*^9}, {3.515685595984375*^9, 
   3.515685598703125*^9}, {3.51572598011862*^9, 3.5157259948825703`*^9}, 
   3.51862799871875*^9, {3.521778232359375*^9, 3.521778233796875*^9}, 
   3.550859248484375*^9, 3.550927744359375*^9, {3.563791459793933*^9, 
   3.563791474107364*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "Tm0", ",", "0.", ",", "double", ",", "\"\<Nm\>\"", ",", 
       "\"\<zero speed friction of gear\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "wc", ",", "1.", ",", "double", ",", "\"\<rad/s\>\"", ",", 
       "\"\<Friction speed (for numerics)\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "Bm", ",", "0.0012", ",", "double", ",", "\"\<Ns/m\>\"", ",", 
       "\"\<Visc. fric. coeff., gear\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "Jm", ",", "1", ",", "double", ",", "\"\<kg m^2\>\"", ",", 
       "\"\<Moment of inertia, gear\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "myg", ",", ".01", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<friction. coeff. of gear (at output)\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "mys", ",", "0.001", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<friction. coeff. of screw)\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "BL", ",", "0.0", ",", "double", ",", "\"\<Ns/m\>\"", ",", 
       "\"\<Visc. fric. coeff., load\>\""}], "}"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "JL", ",", "1", ",", "double", ",", "\"\<kg m^2\>\"", ",", 
       "\"\<Moment of inertia, load\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "pitch", ",", "0.0008", ",", "double", ",", "\"\<m/rad\>\"", ",", 
       "\"\<gear ratio sf2/sfim\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "ds", ",", "0.05", ",", "double", ",", "\"\<m\>\"", ",", 
       "\"\<Screw effective diameter\>\""}], "}"}], ",", 
     RowBox[{"{", 
      RowBox[{
      "la", ",", "0.08", ",", "double", ",", "\"\<m\>\"", ",", 
       "\"\<link length\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "gearRatio", ",", "1.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<gearing w1/w2\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{"thetamin", ",", 
       RowBox[{"-", "1."}], ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<min angle\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "thetamax", ",", "1.", ",", "double", ",", "\"\<\>\"", ",", 
       "\"\<min angle\>\""}], "}"}]}], " ", "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.51370929940625*^9, 3.51370929940625*^9}, {
   3.513709582640625*^9, 3.513709583484375*^9}, {3.513939656771557*^9, 
   3.513939661740243*^9}, {3.515524764375*^9, 3.515524840125*^9}, {
   3.515727322344883*^9, 3.5157273865459538`*^9}, 3.518260862875*^9, 
   3.518261225265625*^9, 3.519040872671875*^9, 3.519040945984375*^9, 
   3.51906377815625*^9, {3.51911507559375*^9, 3.519115108265625*^9}, {
   3.519115167890625*^9, 3.51911521371875*^9}, {3.51911576046875*^9, 
   3.519115764109375*^9}, {3.519118910390625*^9, 3.519118922671875*^9}, {
   3.5191190169375*^9, 3.5191191019375*^9}, {3.519192115375*^9, 
   3.5191921193125*^9}, {3.5375238393139815`*^9, 3.5375238484855795`*^9}, {
   3.537524323352693*^9, 3.5375243361023664`*^9}, {3.55074595865625*^9, 
   3.55074596603125*^9}, {3.5509001643125*^9, 3.550900165421875*^9}, {
   3.550927754515625*^9, 3.550927784640625*^9}, {3.5509282480625*^9, 
   3.55092829915625*^9}, 3.563791294941449*^9, {3.563791489954949*^9, 
   3.563791516450863*^9}, {3.563791682544863*^9, 3.5637916990368633`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"outputVariables", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "wm", ",", "0.", ",", "double", ",", "\"\<rad/s\>\"", ",", 
       "\"\<motor speed\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "tormg", ",", "0.", ",", "double", ",", "\"\<Nm\>\"", ",", 
       "\"\<Generated motor torque\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "Pin", ",", "0.", ",", "double", ",", "\"\<Nm\>\"", ",", 
       "\"\<Input power\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "Pout", ",", "0.", ",", "double", ",", "\"\<Nm\>\"", ",", 
       "\"\<Output power\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.518547082234375*^9, 3.5185471520625*^9}, 
   3.518547487640625*^9, {3.518628009390625*^9, 3.518628013953125*^9}, {
   3.51904117421875*^9, 3.5190412405625*^9}, {3.519105757*^9, 
   3.51910577603125*^9}, {3.51910591740625*^9, 3.519105935296875*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"wme", "=", 
   RowBox[{"gear1", " ", "wmr1"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Tm0e", "=", " ", 
   RowBox[{"Tm0", " ", 
    RowBox[{"limit", "[", " ", 
     RowBox[{
      RowBox[{"wmr1", "/", " ", "wc"}], ",", 
      RowBox[{"-", "1."}], ",", "1."}], "]"}]}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"tormge", "=", "tormr0"}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"tore", "=", " ", "tormge"}], ";"}]}], "Input",
 CellChangeTimes->{{3.515560667421875*^9, 3.5155606675*^9}, {
   3.515560725140625*^9, 3.515560785453125*^9}, {3.5155609716875*^9, 
   3.515560972265625*^9}, 3.518260873453125*^9, 3.51904099365625*^9, {
   3.519041154953125*^9, 3.51904115653125*^9}, {3.51910365884375*^9, 
   3.519103674109375*^9}, 3.5191037251875*^9, {3.51911567465625*^9, 
   3.519115708015625*^9}, 3.5371673845764513`*^9, {3.5508988203125*^9, 
   3.5508988296875*^9}, {3.563795178385764*^9, 3.563795185832509*^9}, 
   3.5643964410046463`*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Tfrg", "=", 
   RowBox[{
    RowBox[{"(", 
     RowBox[{"myg", " ", 
      RowBox[{"Abs", "[", 
       RowBox[{"tormr1", "/", "gear1"}], "]"}]}], ")"}], " ", 
    RowBox[{"limit", "[", " ", 
     RowBox[{
      RowBox[{"wmr1", "/", " ", "wc"}], ",", 
      RowBox[{"-", "1."}], ",", "1."}], "]"}]}]}], ";"}]], "Input",
 CellChangeTimes->{
  3.51911504184375*^9, {3.51911515415625*^9, 3.51911516159375*^9}, {
   3.51911523025*^9, 3.519115245296875*^9}, 3.519115521796875*^9, {
   3.51911561315625*^9, 3.519115638296875*^9}, 3.519115712546875*^9, 
   3.51911581653125*^9, {3.5371673679045763`*^9, 3.5371673845920763`*^9}, {
   3.5375238091108565`*^9, 3.5375238286108565`*^9}, {3.5375238869518676`*^9, 
   3.5375238961231556`*^9}, {3.5508979645*^9, 3.55089796478125*^9}, {
   3.550898880203125*^9, 3.550898896234375*^9}, {3.5508989648125*^9, 
   3.550898988984375*^9}, {3.550900419953125*^9, 3.550900421375*^9}, {
   3.550928311828125*^9, 3.550928315*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Tfrs", "=", 
   RowBox[{
    RowBox[{"(", 
     RowBox[{"mys", " ", 
      RowBox[{"Abs", "[", 
       RowBox[{"tormr1", " ", 
        RowBox[{"ds", "/", 
         RowBox[{"(", 
          RowBox[{"2", "la"}], ")"}]}]}], "]"}]}], ")"}], " ", 
    RowBox[{"limit", "[", "  ", 
     RowBox[{
      RowBox[{"wmr1", "/", " ", "wc"}], ",", 
      RowBox[{"-", "1."}], ",", "1."}], "]"}]}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5375238054858565`*^9, 3.5375238340014815`*^9}, {
   3.5375239025758677`*^9, 3.537523905544428*^9}, 3.55089796890625*^9, {
   3.550898874953125*^9, 3.55089887765625*^9}, {3.550898970609375*^9, 
   3.55089898240625*^9}, {3.55091543646875*^9, 3.550915436515625*^9}, {
   3.55092831903125*^9, 3.550928324484375*^9}, 3.563795135679494*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"gear1", "=", 
   RowBox[{"(", 
    FractionBox[
     RowBox[{"gearRatio", " ", "la"}], "pitch"], ")"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"gear2", "=", 
   RowBox[{"(", 
    FractionBox["la", "pitch"], ")"}]}], ";"}]}], "Input",
 CellChangeTimes->{{3.5375236877983565`*^9, 3.5375237150952315`*^9}, {
  3.550898310453125*^9, 3.550898331359375*^9}, {3.550898650328125*^9, 
  3.5508986540625*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"wme", "=", 
   RowBox[{"gearRatio", " ", "wmgear"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"vscrew", "=", " ", 
   RowBox[{"wmr1", " ", "la"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"wmgear", "=", 
   FractionBox["vscrew", "pitch"]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"wmgear", "=", 
   RowBox[{"gear1", " ", "wmr1"}]}], ";"}]}], "Input",
 CellChangeTimes->{{3.5375226898608565`*^9, 3.5375227970796065`*^9}, 
   3.5375231527827315`*^9, {3.5375232320952315`*^9, 3.5375232444389815`*^9}, 
   3.5375236034546065`*^9, 3.550924462390625*^9, {3.5643952654008665`*^9, 
   3.5643952661888666`*^9}, {3.5643953696688666`*^9, 3.5643953738608665`*^9}}],

Cell[CellGroupData[{

Cell[BoxData["wmgear"], "Input"],

Cell[BoxData[
 FractionBox[
  RowBox[{"gearRatio", " ", "la", " ", "wmr1"}], "pitch"]], "Output",
 CellChangeTimes->{
  3.550924458296875*^9, 3.5637943020451393`*^9, 3.563795147526679*^9, 
   3.563795202575183*^9, 3.5637952803559604`*^9, 3.5643955455588665`*^9, 
   3.56439613611316*^9, 3.5643962375453024`*^9, {3.564396501826728*^9, 
   3.564396515522097*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData["tore"], "Input",
 CellChangeTimes->{{3.550924715359375*^9, 3.5509247173125*^9}}],

Cell[BoxData["tormr0"], "Output",
 CellChangeTimes->{
  3.5509247176875*^9, 3.563794302073142*^9, 3.563795147557682*^9, 
   3.563795202611187*^9, 3.5637952803889637`*^9, 3.5643955455948668`*^9, 
   3.564396136148164*^9, 3.564396237575305*^9, {3.564396501858731*^9, 
   3.5643965155581007`*^9}}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"Der", "=."}], ";", 
  RowBox[{"s", "=."}], ";"}]], "Input",
 CellChangeTimes->{{3.5375229213921065`*^9, 3.5375229272827315`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDA", ":=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{
           SuperscriptBox["gear1", "2"], " ", "Jm"}], "+", "JL"}], ")"}], " ", 
        RowBox[{"Der", "[", 
         RowBox[{"Der", "[", "thetamr1", " ", "]"}], "]"}]}], "+", " ", 
       RowBox[{"gear1", " ", "Tfrg"}], "+", 
       RowBox[{"gear2", " ", "Tfrs"}], "+", 
       RowBox[{"gear1", " ", "BL", " ", "wmr1"}], "-", "torm0"}], "==", 
      RowBox[{"gear1", " ", "tormr1"}]}], ",", 
     RowBox[{
      RowBox[{
       RowBox[{
        RowBox[{"(", 
         RowBox[{
          RowBox[{
           SuperscriptBox["gear1", "2"], " ", "Jm"}], "+", "JL"}], ")"}], " ", 
        RowBox[{"Der", "[", "wmr1", " ", "]"}]}], "+", " ", 
       RowBox[{"gear1", " ", "Tfrg"}], "+", 
       RowBox[{"gear2", " ", "Tfrs"}], "+", 
       RowBox[{"gear1", " ", "BL", " ", "wmr1"}], "-", "torm0"}], "==", 
      RowBox[{"gear1", " ", "tormr1"}]}]}], "\[IndentingNewLine]", "\t", 
    "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.5137095851875*^9, 3.513709592578125*^9}, {
   3.513711114796875*^9, 3.51371111625*^9}, {3.5155248569375*^9, 
   3.515524880078125*^9}, {3.515524973140625*^9, 3.515524989140625*^9}, {
   3.51552505634375*^9, 3.515525088140625*^9}, {3.515560561484375*^9, 
   3.51556057584375*^9}, 3.515560757375*^9, 3.515560881015625*^9, {
   3.515561183375*^9, 3.515561184140625*^9}, {3.51556127203125*^9, 
   3.5155612795*^9}, {3.5157263492789683`*^9, 3.5157263555012937`*^9}, {
   3.5157297162142982`*^9, 3.5157297444174232`*^9}, {3.518260864515625*^9, 
   3.5182608670625*^9}, {3.518260976875*^9, 3.518261012625*^9}, {
   3.518261087015625*^9, 3.51826110178125*^9}, {3.5182612159375*^9, 
   3.51826127765625*^9}, {3.51826132946875*^9, 3.518261351578125*^9}, {
   3.519040873453125*^9, 3.51904087634375*^9}, {3.51904094640625*^9, 
   3.519040947421875*^9}, 3.5190409941875*^9, 3.51904114153125*^9, {
   3.519041298375*^9, 3.519041305921875*^9}, 3.519103681765625*^9, {
   3.51910372815625*^9, 3.5191037285625*^9}, {3.51911514003125*^9, 
   3.519115140890625*^9}, 3.51911524771875*^9, 3.5371673845920763`*^9, 
   3.53786952125*^9, {3.537869565484375*^9, 3.537869582546875*^9}, {
   3.550744693984375*^9, 3.550744701953125*^9}, {3.5508982625*^9, 
   3.550898269*^9}, {3.550898441890625*^9, 3.550898499640625*^9}, {
   3.5508985379375*^9, 3.550898566484375*^9}, {3.550898677265625*^9, 
   3.55089873809375*^9}, {3.55089879578125*^9, 3.550898798296875*^9}, {
   3.563791315560511*^9, 3.5637913400179567`*^9}, {3.5643954620088663`*^9, 
   3.5643954972378664`*^9}, {3.564396114852034*^9, 3.564396119222471*^9}, {
   3.5643964523607817`*^9, 3.564396472524798*^9}, {3.564396510104555*^9, 
   3.5643965128468294`*^9}, {3.571932783125867*^9, 3.5719327879306755`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemBoundaryEquations", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"tormr0", " ", "==", " ", 
      RowBox[{"cmr0", " ", "+", " ", 
       RowBox[{"Zcmr0", " ", "wmr0"}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"tormr1", " ", "==", " ", 
      RowBox[{"cmr1", " ", "+", " ", 
       RowBox[{"Zcmr1", " ", "wmr1"}]}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.513709484578125*^9, 3.513709484578125*^9}, {
  3.515490149741*^9, 3.515490151006625*^9}, {3.51556122921875*^9, 
  3.51556123359375*^9}, {3.515561274515625*^9, 3.515561294265625*^9}, {
  3.5157263110717087`*^9, 3.515726324467642*^9}, {3.5157298428080482`*^9, 
  3.5157298429017982`*^9}, {3.5158131639265437`*^9, 3.515813165879506*^9}, {
  3.5160312933125*^9, 3.516031294484375*^9}, {3.5637913532872834`*^9, 
  3.563791365573512*^9}, {3.5719327907230806`*^9, 3.571932801081498*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", " ", "=", " ", 
   RowBox[{"{", 
    RowBox[{"thetamr1", ",", "wmr1", ",", "tormr0", ",", "tormr1"}], "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.51370899921875*^9, 3.5137090601875*^9}, {
   3.513709135484375*^9, 3.513709184734375*^9}, 3.515486918636137*^9, {
   3.515493296482911*^9, 3.515493296842286*^9}, {3.515493662074348*^9, 
   3.5154936675586176`*^9}, 3.515493810883874*^9, {3.515561127234375*^9, 
   3.515561128046875*^9}, {3.5157277872105813`*^9, 3.515727788163694*^9}, {
   3.5157297108861732`*^9, 3.5157297109799232`*^9}, 3.519041445078125*^9, {
   3.51910373490625*^9, 3.51910373909375*^9}, {3.550898557984375*^9, 
   3.550898559734375*^9}, {3.5637913739823527`*^9, 3.5637913805810127`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"variable2Limits", "=", 
   RowBox[{"{", 
    RowBox[{"{", 
     RowBox[{"thetamr1", ",", "wmr1", ",", "thetamin", ",", "thetamax"}], 
     "}"}], "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.55092779325*^9, 3.550927829375*^9}, 3.550928018875*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"Pin", "=."}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Pout", "=."}], ";"}]}], "Input",
 CellChangeTimes->{{3.51910586278125*^9, 3.519105869328125*^9}, {
  3.5637932623241777`*^9, 3.563793264324377*^9}, {3.5643967004235854`*^9, 
  3.564396702241767*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", " ", "=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"wmr0", "==", 
      RowBox[{"gear1", " ", "wmr1"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"thetamr0", "==", 
      RowBox[{"gear1", " ", "thetamr1"}]}], ",", " ", "\[IndentingNewLine]", 
     RowBox[{"Pin", "==", 
      RowBox[{"wmr0", " ", "tormr0"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"Pout", "==", 
      RowBox[{"wmr1", " ", "tormr1"}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.515525016296875*^9, 3.515525028234375*^9}, {
   3.5155612083125*^9, 3.51556121028125*^9}, 3.5157297806361732`*^9, {
   3.5190410831875*^9, 3.519041083203125*^9}, {3.519041163625*^9, 
   3.51904116503125*^9}, {3.519041372109375*^9, 3.51904139265625*^9}, {
   3.5191036971875*^9, 3.519103708921875*^9}, {3.519105819578125*^9, 
   3.519105904671875*^9}, {3.55089875759375*^9, 3.550898759671875*^9}, {
   3.56379140165612*^9, 3.563791448970851*^9}, {3.5637952730632315`*^9, 
   3.563795276413566*^9}, 3.5643967137769203`*^9, {3.5719328052155056`*^9, 
   3.5719328199887314`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], ":", 
  " ", "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(1, 1\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.5643965157251177`*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], ":", 
  " ", "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(1, 2\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.5643965157271175`*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Part", "::", "partd"}], "MessageName"], ":", 
  " ", "\<\"Part specification \[NoBreak]\\!\\(delayedPart \
\[LeftDoubleBracket] \\(\\(2, 1\\)\\) \[RightDoubleBracket]\\)\[NoBreak] is \
longer than depth of object. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/partd\\\", ButtonNote -> \
\\\"Part::partd\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.5643965157491198`*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], ":", 
  " ", "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Part :: \
partd\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.56439651575012*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \
\\(\\({\\(\\(\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \\(\\(\[LeftSkeleton] \
1 \[RightSkeleton]\\)\\)}\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \
\\(\\({\\(\\(\\\"isopath\\\" \[Rule] \\\"MechanicScrewActuator.svg\\\"\\)\\), \
\\(\\(\\\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \
\[Rule] \\\"MechanicScrewActuator.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\
\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \\(\\({\
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0\
\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.3333333333333333`\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"Pmr0\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(\[LeftSkeleton] 4 \
\[RightSkeleton]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \
\\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0.8\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
\\\"1\\\"\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \
\[Rule] \\\"PPout\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\
\\)\\)}\\)\\)\\)\\)]\\)\[NoBreak] in \
\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"hopsanobjectappearance\\\", \\(\\({\\(\
\[LeftSkeleton] 1 \[RightSkeleton]\\)}\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \
\\(\\({\\(\\(\\\"isopath\\\" \[Rule] \\\"MechanicScrewActuator.svg\\\"\\)\\), \
\\(\\(\\\"iconrotation\\\" \[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \
\[Rule] \\\"MechanicScrewActuator.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\
\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\({}\\)\\), \\(\\({\
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0\
\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] 0.3333333333333333`\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \\\"Pmr0\
\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \\(\\(\[LeftSkeleton] 4 \
\[RightSkeleton]\\)\\), \\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\
\[LeftSkeleton] 1 \[RightSkeleton]\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\
\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)\\)\\)]\\)\[NoBreak] is not a list of \
contents. The third item in an XMLElement must be a list of contents, even if \
it is an empty list. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.5643965158201265`*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], ":", 
  " ", "\<\"Malformed symbolic XML expression encountered. This may result in \
unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.5643965158251276`*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \[NoBreak]\\!\
\\(\\\"y\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a valid value \
for an attribute in an XMLElement. The value of the attribute must be a \
string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.5643965158271275`*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], ":", 
  " ", "\<\"Malformed symbolic XML expression encountered. This may result in \
unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.564396515829128*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \[NoBreak]\\!\
\\(\\\"y\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a valid value \
for an attribute in an XMLElement. The value of the attribute must be a \
string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.5643965158301277`*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], ":", 
  " ", "\<\"Malformed symbolic XML expression encountered. This may result in \
unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.564396515832128*^9}}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], ":", 
  " ", "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{
  3.537119219921875*^9, 3.550745427484375*^9, {3.550745501890625*^9, 
   3.550745522125*^9}, {3.550745604875*^9, 3.55074562553125*^9}, 
   3.55074568796875*^9, 3.55074579365625*^9, 3.55074589953125*^9, 
   3.55074598403125*^9, 3.550900335609375*^9, 3.550900428125*^9, 
   3.550915536546875*^9, 3.563794302223157*^9, 3.5637951476876945`*^9, 
   3.5637952027472005`*^9, 3.5637952805699816`*^9, 3.5643955458248663`*^9, 
   3.5643961363301816`*^9, 3.56439623772432*^9, {3.5643965020737524`*^9, 
   3.5643965158341284`*^9}}],

Cell[BoxData["\<\"MechanicScrewActuator.xml\"\>"], "Output",
 CellChangeTimes->{
  3.5370072233859053`*^9, 3.5370073353390303`*^9, 3.5370073887765303`*^9, {
   3.5371192018125*^9, 3.537119222265625*^9}, 3.55074542790625*^9, {
   3.550745502203125*^9, 3.55074552246875*^9}, {3.550745609078125*^9, 
   3.55074562584375*^9}, 3.550745689359375*^9, 3.550745793984375*^9, 
   3.550745900765625*^9, 3.55074598434375*^9, 3.550900338671875*^9, 
   3.5509004285625*^9, 3.550915537*^9, 3.563794302387173*^9, 
   3.563795147831709*^9, 3.5637952028672123`*^9, 3.5637952806989946`*^9, 
   3.5643955463458667`*^9, 3.5643961365122004`*^9, 3.564396237875335*^9, {
   3.5643965020847535`*^9, 3.5643965158351283`*^9}}]
}, Open  ]]
}, Closed]],

Cell[CellGroupData[{

Cell["thetaSource", "Section",
 CellChangeTimes->{{3.520961653515625*^9, 3.52096166859375*^9}, 
   3.522604414640625*^9, 3.522604467078125*^9}],

Cell["angle/speed source", "Text"],

Cell[GraphicsData["Metafile", "\<\
CF5dJ6E]HGAYHf4PEfU^I6mgLb15CDHPAVmbKF5d0@0000nP0@0006`0002F0000C0@00:4G002g2`00
8`@00<dC001_H`00o3000215CDH00040X0l00800000300000000000000000000XQ800:PJ003:0000
8@400000000000000000010E0`3XJ0@0AP0002`0000P0000ADe6:`500@0L00004000008@`=/00000
F08005P200160000G00005000015CDH[8T0400`0000000007T0900`000000000940100`000000000
<4020100000400000020?b501`0<0000000000A0000<0000000004H0000X0000700004M4BD<20000
nP000:`4001d5`00RP/0000000160000:00001`00017A4U30P000?X0002N1`00HQ4006H800000000
AP000:00002D0000ADe6:bY0000T000060000000P3l000200000P000P3l000200000P0Q0008h0000
;000008@`=/00000V0000000000004Q30P000000044000000Q30f`000000003o24010b@0000H0000
0Q30f`800000@000GP422?h@0PP00@615D010100000400000000024000080000HP0000`000010000
900002@00000080n000000000000080n0000000000020000G`0003P000010000>0000000000h0000
000000020@0P0`00000000000000000000000000000U000030000040000U0000300000D0081G0000
90000?P0002L1`00Ha4006L800020000MPD68?I31R0U0000300000L0080U000030000000080T0000
90000000P400000000000000P400000000000080000X000030000040000R000030000?oooom60000
700001000015CDH[140000`000000000AP0001@000080000AdA9@`<000160000:00001`00017A4U3
0P0009X@002`1000?QL005@;00000000AP0001P1000<0@00ADe6:bY0000T000060000000P3l00020
0000P000P3l000200000P0Q00P940000>000008@`=/00000gP000000000004Q30P00008000020000
0000@@80000000000Q30f`000000003o24030i00002400000Q30f`d000000000062OA@20XT@LKY95
082RA03`QdEbN<a40?27A@0P04D0l8M5a`<JAAa^TTD002m5062OA@00;dGTDJa5000_A@3@]TG70aY5
0=2fA@0P04D0d;I5LWS<A>AA[4D0P:94062OA@20XT@00`<30`<30`<30`>3cloo5D03010000040000
0P00024000080000HP0000`000010000900002@00000080n000000000000080n0000000000020000
G`0003P000010000>0000000000h0000000000000@0P0`00000000000000000000000000000U0000
30000040000U0000300000D0081E0000D00009P@002^1000?aL005D;000=0000[Tm>53I9CQCf@hhI
mT<68?I3ObHfBKh[[Tnn:bMF_R]VFglVIU/686IKSQTWEThD[Tm>52D0000<00001`00P2D0000<0000
0000P2@0000T00000020@000000000000020@000000000000P0002P0000<00000@000280000<0000
ooooodH0000L0000400004E=AR/4@0003000000000160000500000P00017A4U30`0004H0000X0000
700004M4BD<20000j1<00:`4001d5`00RP/0000000160000D00004@00015CDH[:T0002@0000H0000
0020?`00080000200020?`00080000202T00`1`0000@0000ooooo`40003/4k04Q0?F1R4000080000
HP0000`000010000900002@00000080n000000000000080n00000000000200009`0001P000010000
00000?ooo`0000009@0000`0000100009@0000`000080020EP000300003[4`00[`@0070G00262`00
1@000:i?_Q:^CaH^_UdF;[iM_Q:^CkhB9@0000`0000700209@0000`000000020900002@000000810
00000000000008100000000000020000AP0008`000200000ADe6:`Q010900000=000008@`=/00000
eP00000000000<Q00P000080000000110P00000000024<3K00000?ooool8@0D3;000020000024<3K
10000010003/4k04k1>62g0GQP]`5k040041PAE01@0@0000100000@0000j0000300000P0000T0000
90000000P3h0000000000000P3h0000000000080001O0000>0000080000h0000000003P000000000
020101T000000000oooo000000000000000002D0000<00000P0002D0000<00001@00P5H0000/0000
bQ<008h4002A5`00Y`/000@0002^CkhB[TlF;[iM5RjnGKhB9@0000`0000700209@0000`000000020
900002@00000081000000000000008100000000000020000:00000`000020000>P0000`0000:0000
8P0000`0003oooooAP0001`0000@0000ADe6:`A0000<0000000004H0000D0000200004M4BD<30000
AP0002P0000L0000AdA9@`80003j0000WPL0068A001V2000000004H000140000>00004E=AR/Z@000
900001P00000080o0000P0000800080o0000P000080E@040400000@0000000008@0000P0001R0000
30000040000T000090000000P3h0000000000000P3h0000000000080001O0000>0000080000h0000
000003P00000000000810203000000000000000000000000000002D0000<00000P0002D0000<0000
1@00P5L0000T0000n00009`7001S4@00I`P00080001f1@HPmT<682D0000<00001`00P2D0000<0000
0000P2@0000T00000020@000000000000020@000000000000P0002P0000<00000P000280000<0000
ooooodH0000L0000400004E=AR/4@0003000000000160000500000P00017A4U30`0004H0000X0000
700004M4BD<20000VQ000;04000n5`00E0/0000000160000A00003P00015CDH[:T0002@0000H0000
0020?`00080000200020?`00080000205D030100000400000P00024000080000HP0000`000010000
900002@00000080n000000000000080n0000000000020000G`0003P000020000>0000000000h0000
000000000@0P0`00000000000000000000000000000U000030000080000U0000300000D0081E0000
D00009P@002^1000?aL005D;000=0000[Tm>53I9CQCf@hhImT<68?I3ObHfBKh[[Tnn:bMF_R]VFglV
IU/686IKSQTWEThD[Tm>52D0000<00001`00P2D0000<00000000P2@0000T00000020@00000000000
0020@000000000000P0002P0000<00000P000280000<0000ooooodH0000L0000400004E=AR/4@000
3000000000160000500000P00017A4U30`0004H0000X0000700004M4BD<20000j1<00:`4001d5`00
RP/0000000160000D00004@00015CDH[:T0002@0000H00000020?`00080000200020?`0008000020
2T00`1`0000@0000ooooo`40003/4k04Q0?F1R4000080000HP0000`000010000900002@00000080n
000000000000080n00000000000200009@0000`0000100009@0000`000080020EP000300003[4`00
[`@0070G00262`001@000:i?_Q:^CaH^_UdF;[iM_Q:^CkhB9@0000`0000700209@0000`000000020
900002@00000081000000000000008100000000000020000AP000200000D0000ADe6:aE01@0@0000
100000@0000j0000300000P0000T000090000000P3h0000000000000P3h0000000000080001O0000
>0000080000h0000000003P000000000020101T000000000oooo000000000000000002D0000<0000
0P0002D0000<00001@00P5H0000/0000bQ<008h4002A5`00Y`/000@0002^CkhB[TlF;[iM5RjnGKhB
9@0000`0000700209@0000`000000020900002@00000081000000000000008100000000000020000
:00000`000020000>P0000`0000:00008P0000`0003oooooAP0001`0000@0000ADe6:`A0000<0000
000004H0000D0000200004M4BD<30000AP0003@0000X0000ADe6:bY0000T000060000000P3l00020
0000P000P3l000200000P24000080000HP0000`000010000C00006@0002F0000C0@00:4G002g2`00
UP0004`4000<5`00K0L002T0ZP00000000000000P3l0000000000000P3l000000000000000000000
000000000000000000000280000<0000ooooodH0000L0000400004E=AR/2@00030000000000>0000
50000000000@00005000
\>"], "Text",
 ImageSize->{177.5, 54.25},
 ImageMargins->{{31, 0}, {0, 0}},
 ImageRegion->{{0, 1}, {0, 1}}],

Cell[CellGroupData[{

Cell["Variables and parameters", "Subsection"],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<ThetaSource\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<Angular position source\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of Fluid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFilenames", "[", 
   RowBox[{"defaultPath", ",", "domain", ",", "displayName"}], "]"}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"ResetComponentVariables", "[", "]"}], ";"}]}], "Input",
 CellChangeTimes->{{3.5137112151875*^9, 3.513711217109375*^9}, {
   3.51378596903125*^9, 3.513785980671875*^9}, 3.515394539753217*^9, {
   3.515775693875*^9, 3.5157757050625*^9}, {3.517048046727305*^9, 
   3.51704806093043*^9}, 3.51707206725*^9, {3.5176530686834764`*^9, 
   3.51765311057437*^9}, {3.517673126703125*^9, 3.517673126796875*^9}, {
   3.5177214423487377`*^9, 3.517721453114225*^9}, {3.5177222281793466`*^9, 
   3.517722236008023*^9}, {3.5192815953125*^9, 3.5192816093125*^9}, 
   3.520960307359375*^9, {3.520960365546875*^9, 3.52096036584375*^9}, {
   3.520961642015625*^9, 3.520961684609375*^9}, 3.5226044345*^9, 
   3.575803420183922*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputVariables", " ", "=", " ", 
   RowBox[{"{", "\n", "\t", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "thetain", ",", "0.", ",", "double", ",", "\"\<rad\>\"", ",", 
       "\"\<angle\>\""}], "}"}], ",", "\n", "\t", 
     RowBox[{"{", 
      RowBox[{
      "win", ",", "0.", ",", "double", ",", "\"\<rad/s\>\"", ",", 
       "\"\<rotational speed\>\""}], "}"}]}], "\n", "\t\t\t\t\t", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.5209604256875*^9, 3.5209604256875*^9}, {
  3.520961571296875*^9, 3.520961578078125*^9}, {3.5226704100625*^9, 
  3.522670413609375*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\n", "    \t\t", 
    RowBox[{"MechanicRotQnode", "[", 
     RowBox[{
     "mr1", ",", "0.", ",", "0.", ",", "\"\<mechanical rotation node 1\>\""}],
      "]"}], "\n", "}"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.520960439671875*^9, 3.5209604396875*^9}, {
  3.520961559375*^9, 3.520961563265625*^9}, {3.520961596515625*^9, 
  3.52096159909375*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"thetamr1", "==", "thetain"}], ",", "\[IndentingNewLine]", 
     RowBox[{"wmr1", "==", "win"}], ",", "\[IndentingNewLine]", 
     RowBox[{"tormr1", "==", 
      RowBox[{"cmr1", "+", 
       RowBox[{"Zcmr1", " ", "wmr1"}]}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellChangeTimes->{{3.520961532890625*^9, 3.5209615534375*^9}, 
   3.52096161175*^9, {3.522655800796875*^9, 3.522655854453125*^9}, 
   3.52265613753125*^9, 3.52265983521875*^9, {3.5719329918230333`*^9, 
   3.5719330048958564`*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Compgen", "[", "file", "]"}]], "Input"],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "cntsList"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(XMLElement[\\(\\(\\\"modelobject\\\", \\(\\(\
\[LeftSkeleton] 1 \[RightSkeleton]\\)\\), \
\\(\\({\\(\\(XMLElement[\\(\\(\\\"icon\\\", \\(\\({\\(\\(\\\"isopath\\\" \
\[Rule] \\\"MechanicThetaSource.svg\\\"\\)\\), \\(\\(\\\"iconrotation\\\" \
\[Rule] \\\"ON\\\"\\)\\), \\(\\(\\\"userpath\\\" \[Rule] \
\\\"MechanicThetaSource.svg\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpositions\\\", \\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\), \\(\\({\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \
\\(\\({\\(\\(\\\"x\\\" \[Rule] \\\"0\\\"\\)\\), \\(\\(\\\"y\\\" \[Rule] \
0.5`\\)\\), \\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \
\[Rule] \\\"Pmr1\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
\\(\\(\[LeftSkeleton] 19 \[RightSkeleton]\\)\\)\\)\\), \\(\\(\[LeftSkeleton] \
2 \[RightSkeleton]\\)\\), \\(\\(\\\"name\\\" \[Rule] \\(\\(\\\"\\\" \
\[Ellipsis] \\\"\\\"\\)\\)\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\), \
\\(\\(XMLElement[\\(\\(\\\"portpose\\\", \\(\\({\\(\\(\\\"x\\\" \[Rule] \
0.6666666666666666`\\)\\), \\(\\(\\\"y\\\" \[Rule] \\\"0\\\"\\)\\), \
\\(\\(\\\"a\\\" \[Rule] \\\"90\\\"\\)\\), \\(\\(\\\"name\\\" \[Rule] \
\\\"win\\\"\\)\\)}\\)\\), \\(\\({}\\)\\)\\)\\)]\\)\\)}\\)\\)\\)\\)]\\)\\)}\\)\
\\)\\)\\)]\\)\[NoBreak] in \[NoBreak]\\!\\(XMLElement[\\(\\(\[LeftSkeleton] 1 \
\[RightSkeleton]\\)\\)]\\)\[NoBreak] is not a list of contents. The third \
item in an XMLElement must be a list of contents, even if it is an empty \
list. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::cntsList\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803588678483*^9, 3.575803657093483*^9, 
  3.575803757377483*^9, 3.575803796471483*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], ":", 
  " ", "\<\"Malformed symbolic XML expression encountered. This may result in \
unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803588678483*^9, 3.575803657093483*^9, 
  3.575803757377483*^9, 3.5758037964724827`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(0.5`\\)\[NoBreak] in \[NoBreak]\\!\\(\\\"y\\\" \
\[Rule] 0.5`\\)\[NoBreak] is not a valid value for an attribute in an \
XMLElement. The value of the attribute must be a string. \
\\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", ButtonStyle->\\\"Link\\\", \
ButtonFrame->None, ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803588678483*^9, 3.575803657093483*^9, 
  3.575803757377483*^9, 3.575803796473483*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], ":", 
  " ", "\<\"Malformed symbolic XML expression encountered. This may result in \
unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803588678483*^9, 3.575803657093483*^9, 
  3.575803757377483*^9, 3.575803796475483*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(0.3333333333333333`\\)\[NoBreak] in \[NoBreak]\\!\
\\(\\\"x\\\" \[Rule] 0.3333333333333333`\\)\[NoBreak] is not a valid value \
for an attribute in an XMLElement. The value of the attribute must be a \
string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803588678483*^9, 3.575803657093483*^9, 
  3.575803757377483*^9, 3.5758037964764833`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"Export", "::", "autofix"}], "MessageName"], ":", 
  " ", "\<\"Malformed symbolic XML expression encountered. This may result in \
unexpected XML data. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/Export\\\", ButtonNote -> \\\"Export::autofix\\\"]\
\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803588678483*^9, 3.575803657093483*^9, 
  3.575803757377483*^9, 3.5758037964794827`*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], ":", 
  " ", "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(Export :: \
autofix\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803588678483*^9, 3.575803657093483*^9, 
  3.575803757377483*^9, 3.575803796480483*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"XMLElement", "::", "attrhs"}], "MessageName"], ":", 
  " ", "\<\"\[NoBreak]\\!\\(0.6666666666666666`\\)\[NoBreak] in \[NoBreak]\\!\
\\(\\\"x\\\" \[Rule] 0.6666666666666666`\\)\[NoBreak] is not a valid value \
for an attribute in an XMLElement. The value of the attribute must be a \
string. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/XMLElement\\\", ButtonNote -> \
\\\"XMLElement::attrhs\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803588678483*^9, 3.575803657093483*^9, 
  3.575803757377483*^9, 3.575803796482483*^9}],

Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{"General", "::", "stop"}], "MessageName"], ":", 
  " ", "\<\"Further output of \[NoBreak]\\!\\(\\*StyleBox[\\(XMLElement :: \
attrhs\\), \\\"MessageName\\\"]\\)\[NoBreak] will be suppressed during this \
calculation. \\!\\(\\*ButtonBox[\\\"\[RightSkeleton]\\\", \
ButtonStyle->\\\"Link\\\", ButtonFrame->None, \
ButtonData:>\\\"paclet:ref/message/General/stop\\\", ButtonNote -> \
\\\"General::stop\\\"]\\)\"\>"}]], "Message", "MSG",
 CellChangeTimes->{3.575803588678483*^9, 3.575803657093483*^9, 
  3.575803757377483*^9, 3.5758037964834833`*^9}],

Cell[BoxData["\<\"MechanicThetaSource.xml\"\>"], "Output",
 CellChangeTimes->{3.5331526526875*^9, 3.533153561734375*^9, 
  3.533154045375*^9, 3.533154170421875*^9, 3.53315485996875*^9, 
  3.53319543890625*^9, 3.5332074579375*^9, 3.533221827296875*^9, 
  3.533221931078125*^9, 3.535556432796875*^9, 3.535557188171875*^9, 
  3.535557237421875*^9, 3.535557779609375*^9, 3.5355578385625*^9, 
  3.535608293171875*^9, 3.535608506421875*^9, 3.53560996778125*^9, 
  3.535611941875*^9, 3.53561744096875*^9, 3.535624604703125*^9, 
  3.535688449400501*^9, 3.5356888577516465`*^9, 3.5356923509931335`*^9, 
  3.538977658396036*^9, 3.5547157551707478`*^9, 3.575803588701483*^9, 
  3.5758036571234827`*^9, 3.575803757410483*^9, 3.5758037964834833`*^9}]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Open  ]],

Cell[CellGroupData[{

Cell["Crane", "Section",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.519281468671875*^9, 3.519281469359375*^9}, 
   3.5226043241875*^9, 3.522604355609375*^9, 3.525534334828125*^9, 
   3.533225155609375*^9, 3.535557679125*^9, {3.5768627650047483`*^9, 
   3.5768627657927933`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"domain", "=", "\"\<Mechanic\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"displayName", "=", "\"\<Mkload01D\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"brief", "=", "\"\<An inertia load with spring and damper\>\""}], 
  ";"}], "\n", 
 RowBox[{
  RowBox[{"componentType", "=", "\"\<ComponentQ\>\""}], ";"}], "\n", 
 RowBox[{
  RowBox[{"author", "=", "\"\<Petter Krus <petter.krus@liu.se>\>\""}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{
  "affiliation", " ", "=", " ", 
   "\"\<Division of FLuid and Mechatronic Systems, Link\[ODoubleDot]ping \
University\>\""}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"SetFile", "[", 
   RowBox[{"domain", ",", "displayName"}], "]"}], ";"}]}], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.503905077842648*^9, 3.503905079842648*^9}, {
   3.5039103076641607`*^9, 3.5039103985397425`*^9}, {3.5039164662834997`*^9, 
   3.5039164750178747`*^9}, {3.5039165143772497`*^9, 
   3.5039165189397497`*^9}, {3.5041051675625*^9, 3.504105226359375*^9}, {
   3.507570546125*^9, 3.507570569546875*^9}, {3.507570601046875*^9, 
   3.50757067696875*^9}, 3.507796401609375*^9, {3.507887022343302*^9, 
   3.507887057967846*^9}, {3.5078871702320337`*^9, 3.507887175028847*^9}, {
   3.5082235454098396`*^9, 3.5082235597692146`*^9}, 3.5082237305660896`*^9, {
   3.512921352515625*^9, 3.512921388578125*^9}, 3.513861419*^9, 
   3.5226043241875*^9, 3.525534334828125*^9, 3.533225112109375*^9, 
   3.535557679125*^9}],

Cell[BoxData[
 RowBox[{"ResetComponentVariables", "[", "]"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{3.5226043241875*^9, 3.525534334828125*^9, 
  3.535557679125*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"inputParameters", "  ", "=", " ", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"{", 
      RowBox[{
      "mL", ",", "1000.", ",", "double", ",", "\"\<kg\>\"", ",", 
       "\"\<Inertia\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "bL", ",", "10.", ",", "double", ",", "\"\<Ns/m\>\"", ",", 
       "\"\<Visc. friction coeff.\>\""}], "}"}], ",", "\[IndentingNewLine]", 
     RowBox[{"{", 
      RowBox[{
      "kL", ",", "10.", ",", "double", ",", "\"\<N/m\>\"", ",", 
       "\"\<Spring constant\>\""}], "}"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.519016849310559*^9, 3.5190168493261824`*^9}, 
   3.5226043241875*^9, 3.525534334828125*^9, 3.535557679125*^9, {
   3.5356921965096245`*^9, 3.53569219919709*^9}, {3.5719321491201143`*^9, 
   3.5719321601181335`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"nodeConnections", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"MechanicQnode", "[", 
      RowBox[{"m1", ",", "0.", ",", "\"\<mechanical node 1\>\""}], "]"}], ",",
      "\[IndentingNewLine]", 
     RowBox[{"MechanicQnode", "[", 
      RowBox[{"m2", ",", "0.", ",", "\"\<mechanical node 2\>\""}], "]"}]}], 
    "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.51901685320086*^9, 3.519016853216484*^9}, {
   3.521913885921875*^9, 3.521913887859375*^9}, 3.5226043241875*^9, 
   3.525534334828125*^9, 3.535557679125*^9, {3.571932162551738*^9, 
   3.57193216922855*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"initialExpressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{"xm1", "==", 
     RowBox[{"-", "xm2"}]}], "\[IndentingNewLine]", "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{
  3.51901688034019*^9, {3.521913926984375*^9, 3.521913928296875*^9}, 
   3.522604324203125*^9, 3.525534334828125*^9, 3.535557679125*^9, {
   3.571932201021405*^9, 3.5719322130802264`*^9}}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"x11", "=", 
   RowBox[{"xcg", "-", 
    RowBox[{
     FractionBox["l1", "2"], 
     RowBox[{"Cos", "[", "theta1", "]"}]}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"x12", "=", 
   RowBox[{"xcg", "+", 
    RowBox[{
     FractionBox["l1", "2"], 
     RowBox[{"Cos", "[", "theta1", "]"}]}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"z11", "=", 
   RowBox[{"zcg", "-", 
    RowBox[{
     FractionBox["l1", "2"], 
     RowBox[{"Sin", "[", "theta1", "]"}]}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"z12", "=", 
   RowBox[{"zcg", "+", 
    RowBox[{
     FractionBox["l1", "2"], 
     RowBox[{"Sin", "[", "theta1", "]"}]}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"x21", "=", 
   RowBox[{"xcg", "-", 
    RowBox[{
     FractionBox["l2", "2"], 
     RowBox[{"Cos", "[", "theta2", "]"}]}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"x21", "=", 
   RowBox[{"xcg", "+", 
    RowBox[{
     FractionBox["l2", "2"], 
     RowBox[{"Cos", "[", "theta2", "]"}]}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"z21", "=", 
   RowBox[{"zcg", "-", 
    RowBox[{
     FractionBox["l2", "2"], 
     RowBox[{"Sin", "[", "theta2", "]"}]}]}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"z22", "=", 
   RowBox[{"zcg", "+", 
    RowBox[{
     FractionBox["l2", "2"], 
     RowBox[{"Sin", "[", "theta2", "]"}]}]}]}], ";"}]}], "Input",
 CellChangeTimes->{{3.5768642815144873`*^9, 3.5768643281061525`*^9}, {
  3.5768643665553513`*^9, 3.5768644607967415`*^9}, {3.576864516673938*^9, 
  3.5768645224792695`*^9}, {3.5768645567522297`*^9, 3.576864600367725*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemEquationsDA", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{
      RowBox[{"mL", " ", 
       RowBox[{"Der", "[", "vcg1", "]"}]}], "==", 
      RowBox[{"(", 
       RowBox[{"fx11", "-", "fx12"}], ")"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"mL", " ", 
       RowBox[{"Der", "[", "vcg1", "]"}]}], "==", 
      RowBox[{"(", 
       RowBox[{"fz11", "-", "fz12"}], ")"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"JL", " ", 
       RowBox[{"Der", "[", "omega1", "]"}]}], "\[Equal]", "tor1"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "xcg1", "]"}], "==", "vcg1"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "theta1", "]"}], "==", "omega1"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"mL", " ", 
       RowBox[{"Der", "[", "vcg2", "]"}]}], "==", 
      RowBox[{"(", 
       RowBox[{"fx21", "-", "fx22"}], ")"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"mL", " ", 
       RowBox[{"Der", "[", "vcg2", "]"}]}], "==", 
      RowBox[{"(", 
       RowBox[{"fz21", "-", "fz22"}], ")"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "xcg2", "]"}], "==", "vcg2"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"Der", "[", "theta2", "]"}], "==", "omega2"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{
      RowBox[{"JL", " ", 
       RowBox[{"Der", "[", "omega2", "]"}]}], "\[Equal]", "tor2"}], ",", 
     "\[IndentingNewLine]", 
     RowBox[{"x11", "==", 
      RowBox[{"xcg", "-", 
       RowBox[{
        FractionBox["l1", "2"], 
        RowBox[{"Cos", "[", "theta1", "]"}]}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"x12", "==", 
      RowBox[{"xcg", "+", 
       RowBox[{
        FractionBox["l1", "2"], 
        RowBox[{"Cos", "[", "theta1", "]"}]}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"z11", "==", 
      RowBox[{"zcg", "-", 
       RowBox[{
        FractionBox["l1", "2"], 
        RowBox[{"Sin", "[", "theta1", "]"}]}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"z12", "==", 
      RowBox[{"zcg", "+", 
       RowBox[{
        FractionBox["l1", "2"], 
        RowBox[{"Sin", "[", "theta1", "]"}]}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"x21", "==", 
      RowBox[{"xcg", "-", 
       RowBox[{
        FractionBox["l2", "2"], 
        RowBox[{"Cos", "[", "theta2", "]"}]}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"x21", "==", 
      RowBox[{"xcg", "+", 
       RowBox[{
        FractionBox["l2", "2"], 
        RowBox[{"Cos", "[", "theta2", "]"}]}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"z21", "==", 
      RowBox[{"zcg", "-", 
       RowBox[{
        FractionBox["l2", "2"], 
        RowBox[{"Sin", "[", "theta2", "]"}]}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"z22", "==", 
      RowBox[{"zcg", "+", 
       RowBox[{
        FractionBox["l2", "2"], 
        RowBox[{"Sin", "[", "theta2", "]"}]}]}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"x12", "\[Equal]", "x21"}], ",", "\[IndentingNewLine]", 
     RowBox[{"z12", "\[Equal]", "z21"}], ",", "\[IndentingNewLine]", 
     RowBox[{"x11", "\[Equal]", "0"}], ",", "\[IndentingNewLine]", 
     RowBox[{"z11", "=", "0"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.52191389025*^9, 3.521913899796875*^9}, 
   3.5226043241875*^9, 3.5253431853125*^9, {3.525344901234375*^9, 
   3.525344916140625*^9}, 3.53322190715625*^9, 3.535557679125*^9, {
   3.571932173487357*^9, 3.5719321788849664`*^9}, {3.5768628250501823`*^9, 
   3.5768628365568404`*^9}, {3.576863684513341*^9, 3.576863910670276*^9}, {
   3.576864341931943*^9, 3.5768643621190977`*^9}, {3.576864610483303*^9, 
   3.576864723743781*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemBoundaryEquations", " ", "=", " ", 
   RowBox[{"{", "\n", "\t", 
    RowBox[{
     RowBox[{"fm1", " ", "==", " ", 
      RowBox[{"cm1", " ", "-", " ", 
       RowBox[{"Zcm1", " ", "vm2"}]}]}], ",", "\n", "\t", 
     RowBox[{"fm2", " ", "==", " ", 
      RowBox[{"cm2", " ", "+", " ", 
       RowBox[{"Zcm2", " ", "vm2"}]}]}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.5190168632782354`*^9, 3.51901686329386*^9}, {
   3.52191390128125*^9, 3.52191391521875*^9}, {3.52194675112527*^9, 
   3.5219467526095877`*^9}, 3.5226043241875*^9, 3.525534334828125*^9, 
   3.535557679125*^9, {3.571932181334171*^9, 3.5719321950933948`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"systemVariables", " ", "=", " ", 
   RowBox[{"{", 
    RowBox[{"vm2", ",", " ", "xm2", ",", " ", "fm1", ",", " ", "fm2"}], 
    "}"}]}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{
  3.522604324203125*^9, 3.525534334828125*^9, {3.5261037952044206`*^9, 
   3.5261037984857125`*^9}, 3.533154146171875*^9, {3.53555637615625*^9, 
   3.5355563779375*^9}, 3.535557679125*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"expressions", "=", 
   RowBox[{"{", "\[IndentingNewLine]", 
    RowBox[{
     RowBox[{"vm1", "==", 
      RowBox[{"-", "vm2"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"xm1", "==", 
      RowBox[{"-", "xm2"}]}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqMassm1", "==", "mL"}], ",", "\[IndentingNewLine]", 
     RowBox[{"eqMassm2", "==", "mL"}]}], "\[IndentingNewLine]", "}"}]}], 
  ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{
  3.519016887605582*^9, {3.5219138655625*^9, 3.52191387359375*^9}, {
   3.521913929390625*^9, 3.521913962359375*^9}, 3.522604324203125*^9, 
   3.525534334828125*^9, 3.535557679125*^9, {3.571932216621433*^9, 
   3.5719322342026634`*^9}}],

Cell[BoxData[
 RowBox[{
  RowBox[{"Compgen", "[", "file", "]"}], ";"}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{3.5190168934960184`*^9, 3.522604324203125*^9, 
  3.525534334828125*^9, 3.535557679125*^9}]
}, Closed]]
},
CellGrouping->Manual,
WindowSize->{1008, 688},
WindowMargins->{{63, Automatic}, {Automatic, 19}},
Magnification->1.100000023841858,
FrontEndVersion->"8.0 for Microsoft Windows (64-bit) (October 6, 2011)",
StyleDefinitions->FrontEnd`FileName[{"Creative"}, "NaturalColor.nb", 
  CharacterEncoding -> "WindowsANSI"]
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[CellGroupData[{
Cell[579, 22, 90, 1, 71, "Title"],
Cell[CellGroupData[{
Cell[694, 27, 96, 1, 83, "Section"],
Cell[793, 30, 356, 6, 43, "Input"],
Cell[1152, 38, 124, 3, 43, "Input"]
}, Open  ]],
Cell[1291, 44, 624, 12, 64, "Input"],
Cell[CellGroupData[{
Cell[1940, 60, 242, 6, 107, "Section"],
Cell[2185, 68, 118, 2, 43, "Input"],
Cell[CellGroupData[{
Cell[2328, 74, 46, 0, 40, "Subsection"],
Cell[2377, 76, 1289, 30, 184, "Input"],
Cell[3669, 108, 1276, 28, 144, "Input"],
Cell[4948, 138, 882, 22, 124, "Input"],
Cell[5833, 162, 1097, 23, 84, "Input"],
Cell[6933, 187, 103, 1, 43, "Input"],
Cell[7039, 190, 1187, 25, 175, "Input"],
Cell[8229, 217, 1163, 28, 104, "Input"],
Cell[9395, 247, 850, 18, 84, "Input"],
Cell[10248, 267, 435, 9, 43, "Input"],
Cell[10686, 278, 1079, 26, 188, "Input"],
Cell[11768, 306, 142, 4, 43, "Input"],
Cell[CellGroupData[{
Cell[11935, 314, 63, 1, 43, "Input"],
Cell[12001, 317, 1462, 25, 23, "Message"],
Cell[13466, 344, 1464, 25, 23, "Message"],
Cell[14933, 371, 1462, 25, 23, "Message"],
Cell[16398, 398, 1458, 25, 23, "Message"],
Cell[17859, 425, 3887, 59, 157, "Message"],
Cell[21749, 486, 1387, 24, 23, "Message"],
Cell[23139, 512, 1534, 26, 23, "Message"],
Cell[24676, 540, 1390, 24, 23, "Message"],
Cell[26069, 566, 1537, 26, 23, "Message"],
Cell[27609, 594, 1390, 24, 23, "Message"],
Cell[29002, 620, 1462, 25, 23, "Message"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[30503, 650, 703, 14, 60, "Input"],
Cell[CellGroupData[{
Cell[31231, 668, 89, 1, 83, "Section"],
Cell[31323, 671, 92, 2, 48, "Text"],
Cell[31418, 675, 6207, 79, 73, "Text"],
Cell[37628, 756, 1451, 31, 294, "Input"],
Cell[39082, 789, 718, 17, 165, "Input"],
Cell[39803, 808, 328, 9, 129, "Input"],
Cell[40134, 819, 536, 11, 229, "Input"],
Cell[40673, 832, 386, 10, 147, "Input"],
Cell[41062, 844, 595, 13, 147, "Input"],
Cell[41660, 859, 748, 16, 196, "Input"],
Cell[42411, 877, 1227, 24, 165, "Input"],
Cell[43641, 903, 1742, 36, 294, "Input"],
Cell[CellGroupData[{
Cell[45408, 943, 63, 1, 67, "Input"],
Cell[45474, 946, 98, 1, 84, "Print"],
Cell[45575, 949, 3118, 48, 84, "Message"],
Cell[48696, 999, 644, 13, 84, "Message"],
Cell[49343, 1014, 791, 15, 84, "Message"],
Cell[50137, 1031, 644, 13, 84, "Message"],
Cell[50784, 1046, 793, 15, 84, "Message"],
Cell[51580, 1063, 646, 13, 84, "Message"],
Cell[52229, 1078, 720, 14, 84, "Message"],
Cell[52952, 1094, 428, 8, 84, "Output"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[53429, 1108, 62, 1, 50, "Section"],
Cell[53494, 1111, 2012, 39, 294, "Input"],
Cell[CellGroupData[{
Cell[55531, 1154, 46, 0, 62, "Subsection"],
Cell[55580, 1156, 1491, 37, 294, "Input"],
Cell[57074, 1195, 174, 4, 67, "Input"],
Cell[57251, 1201, 673, 15, 165, "Input"]
}, Open  ]],
Cell[CellGroupData[{
Cell[57961, 1221, 131, 3, 62, "Subsection",
 Evaluatable->False,
 PageBreakAbove->True],
Cell[58095, 1226, 87, 2, 48, "Text"],
Cell[CellGroupData[{
Cell[58207, 1232, 171, 5, 67, "Input"],
Cell[58381, 1239, 1549, 27, 84, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[59967, 1271, 218, 6, 67, "Input"],
Cell[60188, 1279, 1554, 27, 84, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[61779, 1311, 468, 12, 101, "Input"],
Cell[62250, 1325, 912, 14, 84, "Output"]
}, Open  ]],
Cell[63177, 1342, 1623, 37, 165, "Input"],
Cell[64803, 1381, 630, 14, 165, "Input"],
Cell[65436, 1397, 467, 10, 67, "Input"],
Cell[65906, 1409, 1131, 28, 283, "Input"],
Cell[67040, 1439, 46, 1, 67, "Input"],
Cell[67089, 1442, 238, 7, 67, "Input"],
Cell[CellGroupData[{
Cell[67352, 1453, 63, 1, 67, "Input"],
Cell[67418, 1456, 95, 1, 84, "Print"],
Cell[67516, 1459, 604, 12, 84, "Message"],
Cell[68123, 1473, 604, 12, 84, "Message"],
Cell[68730, 1487, 604, 12, 84, "Message"],
Cell[69337, 1501, 602, 12, 84, "Message"],
Cell[69942, 1515, 2934, 46, 84, "Message"],
Cell[72879, 1563, 530, 11, 84, "Message"],
Cell[73412, 1576, 679, 13, 84, "Message"],
Cell[74094, 1591, 532, 11, 84, "Message"],
Cell[74629, 1604, 677, 13, 84, "Message"],
Cell[75309, 1619, 532, 11, 84, "Message"],
Cell[75844, 1632, 604, 12, 84, "Message"],
Cell[76451, 1646, 722, 10, 84, "Output"]
}, Open  ]]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[77234, 1663, 87, 1, 50, "Section"],
Cell[77324, 1666, 2033, 39, 294, "Input"],
Cell[CellGroupData[{
Cell[79382, 1709, 46, 0, 62, "Subsection"],
Cell[79431, 1711, 1657, 41, 326, "Input"],
Cell[81091, 1754, 174, 4, 67, "Input"],
Cell[81268, 1760, 954, 20, 196, "Input"]
}, Open  ]],
Cell[CellGroupData[{
Cell[82259, 1785, 131, 3, 62, "Subsection",
 Evaluatable->False,
 PageBreakAbove->True],
Cell[82393, 1790, 87, 2, 48, "Text"],
Cell[CellGroupData[{
Cell[82505, 1796, 171, 5, 67, "Input"],
Cell[82679, 1803, 1659, 28, 84, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[84375, 1836, 218, 6, 80, "Input"],
Cell[84596, 1844, 1651, 28, 84, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[86284, 1877, 468, 12, 122, "Input"],
Cell[86755, 1891, 1019, 16, 84, "Output"]
}, Open  ]],
Cell[87789, 1910, 1790, 41, 199, "Input"],
Cell[89582, 1953, 930, 19, 199, "Input"],
Cell[90515, 1974, 529, 10, 67, "Input"],
Cell[91047, 1986, 1370, 32, 347, "Input"],
Cell[92420, 2020, 46, 1, 67, "Input"],
Cell[92469, 2023, 238, 7, 67, "Input"],
Cell[CellGroupData[{
Cell[92732, 2034, 63, 1, 67, "Input"],
Cell[92798, 2037, 94, 1, 84, "Print"],
Cell[92895, 2040, 516, 11, 84, "Message"],
Cell[93414, 2053, 516, 11, 84, "Message"],
Cell[93933, 2066, 3190, 48, 84, "Message"],
Cell[97126, 2116, 531, 11, 84, "Message"],
Cell[97660, 2129, 646, 12, 84, "Message"],
Cell[98309, 2143, 531, 11, 84, "Message"],
Cell[98843, 2156, 644, 12, 84, "Message"],
Cell[99490, 2170, 529, 11, 84, "Message"],
Cell[100022, 2183, 603, 12, 84, "Message"],
Cell[100628, 2197, 646, 12, 84, "Message"],
Cell[101277, 2211, 608, 12, 84, "Message"],
Cell[101888, 2225, 747, 11, 84, "Output"]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Open  ]],
Cell[CellGroupData[{
Cell[102708, 2244, 100, 1, 71, "Title"],
Cell[CellGroupData[{
Cell[102833, 2249, 260, 4, 83, "Section",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[103096, 2255, 1520, 32, 315, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[104619, 2289, 208, 4, 80, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[104830, 2295, 951, 22, 236, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[105784, 2319, 681, 15, 161, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[106468, 2336, 467, 10, 161, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[106938, 2348, 829, 20, 199, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[107770, 2370, 752, 16, 199, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[108525, 2388, 450, 10, 80, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[108978, 2400, 750, 17, 276, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[109731, 2419, 244, 5, 80, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}]
}, Closed]],
Cell[CellGroupData[{
Cell[110012, 2429, 309, 5, 50, "Section",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[110324, 2436, 1563, 32, 315, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[111890, 2470, 230, 4, 80, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[112123, 2476, 1272, 29, 315, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[113398, 2507, 731, 15, 199, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[114132, 2524, 851, 20, 199, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[114986, 2546, 1542, 34, 199, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[116531, 2582, 744, 16, 161, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[117278, 2600, 472, 10, 80, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[117753, 2612, 491, 10, 161, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[118247, 2624, 774, 17, 276, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[119024, 2643, 356, 9, 80, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}],
Cell[119383, 2654, 266, 5, 80, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10001.}]
}, Closed]],
Cell[CellGroupData[{
Cell[119686, 2664, 132, 2, 50, "Section"],
Cell[CellGroupData[{
Cell[119843, 2670, 43, 0, 40, "Subsection"],
Cell[119889, 2672, 1351, 30, 184, "Input"],
Cell[121243, 2704, 1124, 27, 144, "Input"],
Cell[122370, 2733, 612, 13, 84, "Input"],
Cell[122985, 2748, 876, 19, 104, "Input"],
Cell[123864, 2769, 607, 15, 43, "Input"],
Cell[124474, 2786, 943, 24, 104, "Input"],
Cell[125420, 2812, 682, 15, 84, "Input"],
Cell[126105, 2829, 681, 17, 158, "Input"],
Cell[126789, 2848, 265, 7, 43, "Input"],
Cell[CellGroupData[{
Cell[127079, 2859, 63, 1, 43, "Input"],
Cell[127145, 2862, 1472, 25, 23, "Message"],
Cell[128620, 2889, 1472, 25, 23, "Message"],
Cell[130095, 2916, 1472, 25, 23, "Message"],
Cell[131570, 2943, 1468, 25, 23, "Message"],
Cell[133041, 2970, 2683, 43, 119, "Message"],
Cell[135727, 3015, 1400, 24, 23, "Message"],
Cell[137130, 3041, 1547, 26, 23, "Message"],
Cell[138680, 3069, 1400, 24, 23, "Message"],
Cell[140083, 3095, 1547, 26, 23, "Message"],
Cell[141633, 3123, 1400, 24, 23, "Message"],
Cell[143036, 3149, 1474, 25, 23, "Message"],
Cell[144513, 3176, 1515, 25, 23, "Message"],
Cell[146031, 3203, 1477, 25, 23, "Message"],
Cell[147511, 3230, 618, 9, 43, "Output"]
}, Open  ]]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[148190, 3246, 266, 7, 107, "Section"],
Cell[CellGroupData[{
Cell[148481, 3257, 43, 0, 40, "Subsection"],
Cell[148527, 3259, 1352, 31, 184, "Input"],
Cell[149882, 3292, 1169, 27, 144, "Input"],
Cell[151054, 3321, 723, 16, 84, "Input"],
Cell[151780, 3339, 830, 19, 84, "Input"],
Cell[152613, 3360, 683, 16, 43, "Input"],
Cell[153299, 3378, 271, 8, 43, "Input"],
Cell[153573, 3388, 943, 24, 104, "Input"],
Cell[154519, 3414, 979, 23, 124, "Input"],
Cell[155501, 3439, 715, 16, 104, "Input"],
Cell[156219, 3457, 729, 18, 138, "Input"],
Cell[156951, 3477, 376, 9, 43, "Input"],
Cell[157330, 3488, 265, 7, 43, "Input"],
Cell[CellGroupData[{
Cell[157620, 3499, 63, 1, 43, "Input"],
Cell[157686, 3502, 142, 2, 43, "Output"]
}, Open  ]]
}, Open  ]]
}, Open  ]],
Cell[CellGroupData[{
Cell[157889, 3511, 311, 6, 83, "Section",
 Evaluatable->False],
Cell[158203, 3519, 120, 1, 57, "Text"],
Cell[158326, 3522, 2009, 41, 355, "Input"],
Cell[160338, 3565, 1053, 21, 199, "Input"],
Cell[161394, 3588, 3730, 82, 629, "Input"],
Cell[165127, 3672, 1088, 25, 276, "Input"],
Cell[166218, 3699, 1014, 23, 199, "Input"],
Cell[167235, 3724, 988, 21, 80, "Input"],
Cell[168226, 3747, 794, 19, 80, "Input"],
Cell[169023, 3768, 452, 13, 185, "Input"],
Cell[169478, 3783, 724, 16, 231, "Input"],
Cell[CellGroupData[{
Cell[170227, 3803, 32, 0, 80, "Input"],
Cell[170262, 3805, 361, 7, 113, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[170660, 3817, 94, 1, 80, "Input"],
Cell[170757, 3820, 294, 5, 80, "Output"]
}, Open  ]],
Cell[171066, 3828, 164, 4, 80, "Input"],
Cell[171233, 3834, 2888, 55, 213, "Input"],
Cell[174124, 3891, 947, 18, 199, "Input"],
Cell[175074, 3911, 764, 13, 80, "Input"],
Cell[175841, 3926, 284, 7, 80, "Input"],
Cell[176128, 3935, 301, 7, 122, "Input"],
Cell[176432, 3944, 1142, 22, 276, "Input"],
Cell[CellGroupData[{
Cell[177599, 3970, 63, 1, 80, "Input"],
Cell[177665, 3973, 1017, 18, 40, "Message"],
Cell[178685, 3993, 1017, 18, 40, "Message"],
Cell[179705, 4013, 1017, 18, 40, "Message"],
Cell[180725, 4033, 1010, 18, 40, "Message"],
Cell[181738, 4053, 3247, 48, 300, "Message"],
Cell[184988, 4103, 943, 17, 40, "Message"],
Cell[185934, 4122, 1090, 19, 80, "Message"],
Cell[187027, 4143, 941, 17, 40, "Message"],
Cell[187971, 4162, 1090, 19, 80, "Message"],
Cell[189064, 4183, 941, 17, 40, "Message"],
Cell[190008, 4202, 1017, 18, 40, "Message"],
Cell[191028, 4222, 699, 10, 80, "Output"]
}, Open  ]]
}, Closed]],
Cell[CellGroupData[{
Cell[191776, 4238, 143, 2, 50, "Section"],
Cell[191922, 4242, 34, 0, 48, "Text"],
Cell[191959, 4244, 5590, 72, 118, "Text"],
Cell[CellGroupData[{
Cell[197574, 4320, 46, 0, 62, "Subsection"],
Cell[197623, 4322, 1500, 32, 294, "Input"],
Cell[199126, 4356, 617, 16, 165, "Input"],
Cell[199746, 4374, 427, 10, 134, "Input"],
Cell[200176, 4386, 632, 14, 196, "Input"],
Cell[CellGroupData[{
Cell[200833, 4404, 63, 1, 67, "Input"],
Cell[200899, 4407, 2017, 30, 160, "Message"],
Cell[202919, 4439, 516, 10, 34, "Message"],
Cell[203438, 4451, 629, 11, 34, "Message"],
Cell[204070, 4464, 514, 10, 34, "Message"],
Cell[204587, 4476, 663, 12, 34, "Message"],
Cell[205253, 4490, 516, 10, 34, "Message"],
Cell[205772, 4502, 588, 11, 34, "Message"],
Cell[206363, 4515, 661, 12, 34, "Message"],
Cell[207027, 4529, 593, 11, 34, "Message"],
Cell[207623, 4542, 737, 10, 67, "Output"]
}, Open  ]]
}, Open  ]]
}, Closed]]
}, Open  ]],
Cell[CellGroupData[{
Cell[208433, 4560, 310, 5, 83, "Section",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[208746, 4567, 1520, 32, 238, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[210269, 4601, 208, 4, 61, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[210480, 4607, 951, 22, 179, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[211434, 4631, 681, 15, 122, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[212118, 4648, 467, 10, 122, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[212588, 4660, 1655, 51, 453, "Input"],
Cell[214246, 4713, 3840, 97, 946, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[218089, 4812, 752, 16, 150, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[218844, 4830, 450, 10, 61, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[219297, 4842, 750, 17, 209, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[220050, 4861, 244, 5, 61, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}]
}, Closed]]
}
]
*)

(* End of internal cache information *)
